python ConfigParse模块中的方法

1、config=ConfigParser.ConfigParser()  

创建ConfigParser实例  

2、config.sections()  

返回配置文件中节序列  

3、config.options(section)  

返回某个项目中的所有键的序列  

4、config.get(section,option)  

返回section节中,option的键值  

5、config.add_section(str)  

添加一个配置文件节点(str)  

6、config.set(section,option,val)  

设置section节点中,键名为option的值(val)  

7、config.read(filename)  

读取配置文件  

8、config.write(obj_file)  

写入配置文件  

posted @ 2018-12-13 13:58  十年之光  阅读(1163)  评论(0编辑  收藏  举报