摘要: 参考自:https://www.cnblogs.com/alex3714/articles/5717620.html 1. 文件基础操作 f = open('test.txt') #打开文件 first_line = f.readline() # 每次读一行,并移动文件指针 print('first 阅读全文
posted @ 2019-10-29 17:46 wztshine 阅读(886) 评论(0) 推荐(0) 编辑
摘要: 转自:https://www.cnblogs.com/alex3714/articles/5740985.html s = set([3,5,9,10]) # 创建一个数值集合 t = set("Hello") #创建一个唯一字符的集合 a = t | s # t 和 s的并集 b = t & s 阅读全文
posted @ 2019-10-29 17:27 wztshine 阅读(337) 评论(0) 推荐(0) 编辑
摘要: 字典的特性: key唯一 无序(似乎是python3.6以后,字典默认保持插入时的顺序) '''特性:key唯一;无序''' info = { 'stu1101': "安徽", 'stu1102': "北京", 'stu1103': "河南", } # 增删查改 info["stu1104"] = 阅读全文
posted @ 2019-10-29 16:22 wztshine 阅读(810) 评论(0) 推荐(0) 编辑
摘要: list 是 python 常用的数据类型,属于可变的数据类型。用 [] 表示,里面的元素用 , 隔开,并且里面的元素类型可以不同,对于每个元素,list 都有一个索引一一对应,第一个元素的索引是 0,第二个是 1,以此类推... 例如:list1 = [1,'name',['innerList'] 阅读全文
posted @ 2019-10-29 16:01 wztshine 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 转自:https://www.cnblogs.com/zhbzz2007/p/5943685.html 日志回滚部分参考自:https://www.cnblogs.com/andy9468/p/8378492.html Python标准模块--logging 1 logging模块简介 loggin 阅读全文
posted @ 2019-10-29 15:41 wztshine 阅读(404) 评论(0) 推荐(0) 编辑