摘要: 在内置数据类型(dict、list、set、tuple)的基础上,collections模块还提供了几个额外的数据类型:Counter、deque、defaultdict、namedtuple和OrderedDict等。 1.namedtuple: 生成可以使用名字来访问元素内容的tuple 2.d 阅读全文
posted @ 2018-01-24 20:10 Carol-z 阅读(115) 评论(0) 推荐(0)
摘要: 优点:程序的充分解耦,让程序变得高可定制 日志的作用: 阅读全文
posted @ 2018-01-24 17:21 Carol-z 阅读(382) 评论(0) 推荐(0)
摘要: 生成example.ini文件 import configparser config = configparser.ConfigParser() # 查找文件内容,基于字典的形式 print(config.sections()) # [] config.read('example.ini') pri 阅读全文
posted @ 2018-01-24 17:13 Carol-z 阅读(147) 评论(0) 推荐(0)