首页 > 编程语言 > 详细

python 使用中遇到的问题,记录及解决方法

时间:2019-01-10 18:39:48      阅读:208      评论:0      收藏:0      [点我收藏+]

1、读取configparser 配置文件报错   :

提示:

 ConfigParser.MissingSectionHeaderError when parsing rsyncd config file with global options

解决方法:

https://stackoverflow.com/questions/22501121/configparser-missingsectionheadererror-when-parsing-rsyncd-config-file-with-glob

cfg = configparser.ConfigParser()
    with open(file,‘r‘) as fp:
        cfg.read_file(itertools.chain([‘[global]‘], fp), source=file)

    # config.read(file,encoding=‘utf-8‘)
    gw_sip = cfg.get(‘test_sip_endpoint‘,‘gw_sip‘)

python 使用中遇到的问题,记录及解决方法

原文:https://www.cnblogs.com/Ray-Lei/p/10251675.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!