配置文件 cms.conf
[cms]
proxy = 10.39.249.42:51201
innerDomain = http://www.baidu.com
python 解析代码
import ConfigParser
import os
# 本python项目绝对路径
path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
cf = ConfigParser.ConfigParser()
cf.read(path + "/cms/cms.conf")
proxy = cf.get("cms", "proxy")
innerDomain = cf.get("cms", "innerDomain")