摘要: # 签名 为了防止作弊# 1.用户设备号码MD5加密一次# 2.再取加密后的前10位# 3.再加盐,再给他md5一次# 4.生成一个字符串from hashlib import md5class GetSign(object): slat = 'WSL234_#$%_12' def __init__ 阅读全文
posted @ 2018-02-09 16:21 王思磊 阅读(184) 评论(0) 推荐(0) 编辑
摘要: class Person(object): country = 'China' # 类变量 def __init__(self, name, age, sex): self.name = name # 实例变量,必须实例化才能用,也叫成员变量 self.age = age self.sex = se 阅读全文
posted @ 2018-02-09 16:20 王思磊 阅读(113) 评论(0) 推荐(0) 编辑
摘要: import smtplib # 发邮件的from email.mime.text import MIMEText # 构造邮件内容的,对象username = '18033551998@163.com'password = 'jiqiren123'msg = MIMEText('你好,快过年了,新 阅读全文
posted @ 2018-02-09 16:19 王思磊 阅读(140) 评论(0) 推荐(0) 编辑
摘要: import urllib.parses = 'tiger自动化测试'print(urllib.parse.quote(s)) # url编码print(urllib.parse.quote_plus(s)) # url编码src = 'https://www.baidu.com/s?wd=best 阅读全文
posted @ 2018-02-09 16:18 王思磊 阅读(231) 评论(0) 推荐(0) 编辑
摘要: class My(object): def __init__(self, name, skill): self.name = name self.skill = skill self.cry() def cry(self): # 实例方法,必须实例化之后才可以调用 print('%s在哭。。。' % 阅读全文
posted @ 2018-02-09 16:17 王思磊 阅读(116) 评论(0) 推荐(0) 编辑
摘要: import pymysqlclass OpMySql1: # 经典类 passclass OpMySql(object): # 新式类 def __init__(self, host, user, password, db, port=3306, charset='utf8'): schema = 阅读全文
posted @ 2018-02-09 16:16 王思磊 阅读(332) 评论(0) 推荐(0) 编辑
摘要: import xlwt# book = xlwt.Workbook() # 新建一个excel# sheet = book.add_sheet('sheet1') # 添加一个sheet页# sheet.write(0, 0, '姓名')# sheet.write(0, 1, '性别')# shee 阅读全文
posted @ 2018-02-02 22:23 王思磊 阅读(107) 评论(0) 推荐(0) 编辑
摘要: # import urllib.request# import jsonimport requests# url = 'http://api.nnzhp.cn/api/user/stu_info?stu_name=ybq123'# res = urllib.request.urlopen(url) 阅读全文
posted @ 2018-02-02 22:22 王思磊 阅读(98) 评论(0) 推荐(0) 编辑
摘要: import pymysqlconn = pymysql.connect(host='211.149.218.16', user='jxz', password='123456', db='jxz', port=3306, charset='utf8')cur = conn.cursor(curso 阅读全文
posted @ 2018-02-02 22:21 王思磊 阅读(272) 评论(0) 推荐(0) 编辑
摘要: import flask # web框架from day06.tools import op_mysqlimport json# 接口,后台服务server = flask.Flask(__name__) # 把咱们这个python文件当做一个server# 127.0.0.1:8080/get_u 阅读全文
posted @ 2018-01-24 15:15 王思磊 阅读(294) 评论(0) 推荐(0) 编辑