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"));

 

相关文章:

  • 2022-12-23
  • 2021-06-20
  • 2021-08-05
  • 2022-01-12
猜你喜欢
  • 2021-05-22
  • 2021-06-28
  • 2022-12-23
  • 2022-12-23
  • 2021-08-18
  • 2021-10-21
  • 2021-10-27
相关资源
相似解决方案