ConfigParser: '%' must be followed by '%' or '(', found: "%&'" 解决方案

是因为在 config.ini 文件中包含了 % 这种特殊字符

 

解决方案

换一种方式进行读取配置文件
原本代码:cf= configparser.ConfigParser()

替换成:
cf = configparser.RawConfigParser()

 

参考:https://blog.csdn.net/s740556472/article/details/82889758

posted on 2020-07-28 14:25  mlllily  阅读(936)  评论(0编辑  收藏  举报