摘要: import threadingimport timeimport requestsdef say_hi(name): time.sleep(2) print(name)def down_html(url1, name): res = requests.get(url1).content with 阅读全文
posted @ 2018-03-07 15:16 王思磊 阅读(112) 评论(0) 推荐(0) 编辑
摘要: import unittest# import HTMLTestRunner # 难看的测试报告from BeautifulReport import BeautifulReport # 漂亮的测试报告''' assertEqual(a, b) a == b assertNotEqual(a, b) 阅读全文
posted @ 2018-03-07 15:13 王思磊 阅读(129) 评论(0) 推荐(0) 编辑
摘要: # mysqldump -uroot -p123456 -A > nhy123.sqlimport osimport datetimeclass BakDb(object): def __init__(self, ip, username, password, port=3306, path='/t 阅读全文
posted @ 2018-03-07 15:09 王思磊 阅读(269) 评论(0) 推荐(0) 编辑
摘要: class Coon(object): def __init__(self, host, password, port): self.host = host self.password = password self.port = port class CoonMysql(Coon): def __ 阅读全文
posted @ 2018-03-07 14:48 王思磊 阅读(566) 评论(0) 推荐(0) 编辑
摘要: 1.操作excel xlrd 读 xlwt 写 xlutils 修改2.网络编程 urllib url编码 requests模块 r = requests.get(url, data={'x': y}, headers={'x': y}, cookies={'x': y}) r = requests 阅读全文
posted @ 2018-02-09 16:34 王思磊 阅读(103) 评论(0) 推荐(0) 编辑
摘要: class WslFather(object): @property def money(self): return 1000000000 def smoke(self): self.yan = '玉溪' print('抽烟') def drink(self): print('喝酒') def ta 阅读全文
posted @ 2018-02-09 16:33 王思磊 阅读(102) 评论(0) 推荐(0) 编辑
摘要: class Car(object): # 模型,模板 def __init__(self, color, window): # 构造函数,类在初始化的时候会执行它,顺序无所谓,可以写在最下面 # 如果你的类在实例化的时候要传入一些参数,那么你就要在__init__这个函数里写参数了 self.col 阅读全文
posted @ 2018-02-09 16:33 王思磊 阅读(101) 评论(0) 推荐(0) 编辑
摘要: import redisclass MyRedis(object): xiaohei = 'hahaha' def __init__(self, host, password='', port=6379): self.__host = host self.password = password se 阅读全文
posted @ 2018-02-09 16:32 王思磊 阅读(102) 评论(0) 推荐(0) 编辑
摘要: import requestscookies = 'dy_did=d94fe220c9ac1c014987ec5e00061501; _dys_refer_action_code=init_page_studio_v; acf_yb_auth=e5a8f675af47acaeaf434cad9406 阅读全文
posted @ 2018-02-09 16:30 王思磊 阅读(585) 评论(0) 推荐(0) 编辑
摘要: # import traceback# import pymysql# def calc(a, b):# res = (a / b)# return res### def main():# money = input('输入多少钱:')# months = input('还几个月:')# try:# 阅读全文
posted @ 2018-02-09 16:29 王思磊 阅读(138) 评论(0) 推荐(0) 编辑