标签:
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"));
标签:
原文地址:http://www.cnblogs.com/nick-huang/p/4617364.html