ini文件
[weixin_info]
hello = Nick Huang
#coding=utf-8 #!/usr/bin/python import ConfigParser; cp = ConfigParser.ConfigParser(); cp.read('027.99.config.ini'); hello = cp.get('weixin_info', 'hello'); print hello;
#coding=utf-8 #!/usr/bin/python import ConfigParser; cp = ConfigParser.ConfigParser(); cp.add_section("weixin_info"); cp.set("weixin_info", "hello", "Nick Huang"); cp.write(open('027.99.config.ini', "w"));