摘要: 一个个分支找,如下图 a-b-c-d a-e-f-g a-h-i-j class a(b,e,h): a继承了 b , e ,h,当对象obj.x 去找a类,把x=a注释后,他会去找b,b类注释,再找c,c注释去找d,d注释再去找e>f>g x=a 再找h>i>j 就是按照分支去找。 class b 阅读全文
posted @ 2019-11-28 09:40 len1028 阅读(106) 评论(0) 推荐(0) 编辑
摘要: @property class test: @property def tt(self): print('hehehe') def jj(self): print('gggg')obj=test()obj.ttprint(obj.jj)实例化以后拿到对象obj 如果添加@property ,obj. 阅读全文
posted @ 2019-11-13 14:20 len1028 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 压缩import zipfilez = zipfile.ZipFile('test.zip','w')z.write('b.json')z.write('c.json')解压 z = zipfile.ZipFile('test.zip', 'r')z.extractall(path='.')z.cl 阅读全文
posted @ 2019-11-08 09:13 len1028 阅读(166) 评论(0) 推荐(0) 编辑
摘要: os.getcwd() 获取当前工作目录,即当前python脚本工作的目录路径os.chdir("dirname") 改变当前脚本工作目录;相当于shell下cdos.curdir 返回当前目录: ('.')os.pardir 获取当前目录的父目录字符串名:('..')os.makedirs('di 阅读全文
posted @ 2019-11-07 10:59 len1028 阅读(134) 评论(0) 推荐(0) 编辑
摘要: time 模块 print(time.strftime('%Y-%m-%d %T')) 2019-11-07 09:28:06 把时间戳转换为日期 print(time.localtime(1533458405.330393)) time.struct_time(tm_year=2018, tm_m 阅读全文
posted @ 2019-11-07 10:12 len1028 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 简单说,就是把内存中的数据格式转换成对方程序想要识别的数据格式,叫序列化(例如python的数据格式转换成java识别的数据格式), 那么反序列化就是把对方的数据格式化转换成你的程序要识别的格式java->python。 序列化的好处是可以将数据持久化及跨平台交互 json 所有编程语言都可以识别的 阅读全文
posted @ 2019-11-06 15:03 len1028 阅读(149) 评论(0) 推荐(0) 编辑
摘要: pycharm快捷键 CTRL + SHIFT + 上/下(方向箭) 》 将光标所在行的代码向上或向下移动 CTRL + SHIFT + J 》 将光标所在行代码和下一行代码连接为一行,并移除不必要的空格,匹配你的代码样式 CTRL + Y > 删除光标所在行代码 或 选中的行 SHIFT + De 阅读全文
posted @ 2019-11-06 11:11 len1028 阅读(225) 评论(0) 推荐(0) 编辑
摘要: # _*_coding:utf-8_*_# Author:len liuuser_list={'len':'aaa','len1':'bbb','len2':'ccc'}def auth(func): def warrper(*args,**kwargs): #while True: usernam 阅读全文
posted @ 2019-10-21 16:47 len1028 阅读(117) 评论(0) 推荐(0) 编辑
摘要: # _*_coding:utf-8_*_# Author:len liu'''user_passwd.txt 文件格式为 egon|egon123|len|len123|wxx|123|lxx|456'''shop_list = [("iphone",5000),("coffer",80),("疙瘩 阅读全文
posted @ 2019-10-21 16:41 len1028 阅读(278) 评论(0) 推荐(0) 编辑
摘要: # _*_coding:utf-8_*_# Author:len liuimport osimport logging.config#from interface import registerBASE_DIR=os.path.dirname(os.path.dirname(__file__))DB 阅读全文
posted @ 2018-08-04 14:03 len1028 阅读(128) 评论(0) 推荐(0) 编辑