摘要: 很多软件都有配置文件,今天介绍并记录一下ConfigParser模块,解析配置文件。测试配置文件test.conf内容如下: [first]w = 2v: 3c =11-3[second]sw=4test: hello测试配置文件中有两个区域,first和second,另外故意添加一些空格、换行。下面解析:>>> import ConfigParser>>> conf=ConfigParser.ConfigParser()>>> conf.read('test.conf')['test.conf']>& 阅读全文
posted @ 2013-11-26 22:21 除e尘 阅读(522) 评论(0) 推荐(0) 编辑