import ConfigParser
def get_cfg_value(prd):
cf = ConfigParser.ConfigParser()
cf.read(Cfg_File)
opts = cf.options("product id")
if prd.lower() in opts:
match_prd = cf.get("product id",prd)
else:
match_prd = ''
return match_prd.upper()
参考详细说明
python 配置文件 ConfigParser 应用
最新推荐文章于 2021-04-02 08:35:05 发布