| 注册
请输入搜索内容

热门搜索

Java Linux MySQL PHP JavaScript Hibernate jQuery Nginx
jopen
10年前发布

python读取ini配置文件

#!/usr/bin/python  # -*- coding: iso-8859-1 -*-  import ConfigParser     # Open a configuration file  config = ConfigParser.SafeConfigParser()  config.read("config.ini")     # Read the whole configuration file  for section in config.sections():      print "In section %s" % section      for (key, value) in config.items(section):          print "  Key %s has value %s" % (key, value)