摘要: configparser 是什么? 配置文件解析模块 什么是配置文件? 用于提供程序运行所需要的一些信息的文件 后缀 ini cfg 有什么用? 方便用户修改 例如超时时间配置文件内容格式 只包括两种元素 section 分区 option 选项 一个文件可以有多个section 一个section 阅读全文
posted @ 2018-08-13 22:21 星牧 阅读(85) 评论(0) 推荐(0) 编辑
摘要: hashlib hash是什么? 是一种算法 用于将任意长度的数据,压缩映射到一段固定长度的字符 (提取特征) hash的特点: 1.输入数据不同,得到的hash值有可能相同 2.不能通过hash值来得到输入的值 3.如果算法相同,无论输入的数据长度是多少,得到的hash值长度相同 常用的MD5就是一种has... 阅读全文
posted @ 2018-08-13 22:12 星牧 阅读(103) 评论(0) 推荐(0) 编辑
摘要: import xml.etree.ElementTree as ettree = et.parse('a.xml')root = tree.getroot()print(root)#三种查找节点的方式#(1)查找节点的方式 root.iter('year')res = root.iter('year 阅读全文
posted @ 2018-08-13 21:04 星牧 阅读(83) 评论(0) 推荐(0) 编辑
摘要: import shelveinfo = {'age':18,'name':'wxx'}info1 = {'age':16,'name':'cxx'}d = shelve.open('db.shv')d['wxx'] = infod["cxx"] = info1d.close()d = shelve.open('db.shv',writeback=True) #改文件d['wxx']['a... 阅读全文
posted @ 2018-08-13 18:07 星牧 阅读(83) 评论(0) 推荐(0) 编辑