摘要:
import configparserconfig=configparser.ConfigParser()config.read('config.ini') #a.cfg a.ini a.cnf# 并不是字典 key = value 形式# print(config.sections()) # 查看 阅读全文
posted @ 2018-06-25 17:26
Roc_Atlantis
阅读(103)
评论(0)
推荐(0)
摘要:
parse(文件名)打开文件并解析,相比于xml少了打开文件那一步 from xml.etree import ElementTree as ET # 直接解析xml文件 tree = ET.parse("xo.xml") # 获取xml文件的根节点 root = tree.getroot() 通过 阅读全文
posted @ 2018-06-25 17:20
Roc_Atlantis
阅读(694)
评论(0)
推荐(0)
摘要:
其他的看我前面的博客import shutil# 将文件内容拷贝到另一个文件with open('old.xml','r') as read_f,open('new.xml', 'w') as write_f: shutil.copyfileobj(read_f,write_f)# 将文件打包到当前 阅读全文
posted @ 2018-06-25 16:23
Roc_Atlantis
阅读(154)
评论(0)
推荐(0)
摘要:
1.什么是hash? hash是一种算法,该算法接受传入的内容,经过运算得到一个hash值。 如果把hash算法比作一个工厂,那么给hash算法的内容就是原材料,生成的hash值就是得到的产品。 2.为何使用hash算法? hash值有三大特性: 1.只要传入的内容一样,得到的hash值必然是固定的 阅读全文
posted @ 2018-06-25 15:19
Roc_Atlantis
阅读(148)
评论(0)
推荐(0)
浙公网安备 33010602011771号