In general analysis, the last sentence is the key point: When reading the configuration file config.ini, there are % caused by
Solution one:
Most likely configparser is reading the
literal "%" sign in the string. The '%' symbol is used for string
interpolation (substitution). If you want to use a literal "%", you
can escape it with another "%". For example, use "100%%" to
mean "100%" in configuration variables read by configparser.
Solution two:
Change from
cf= configparser.ConfigParser()
to:
cf = configparser.RawConfigParser()
沒有留言:
張貼留言