ConfigParser: values with ";" and the value blank

K

kai

Hello,

I use the ConfigPaserver from Python.
how can I use/save/read values with ";" (start comment) and the value
blank?
When I write (set) my config file often the part behind the ";"
disappears.
e.g.
myKey = startMyValue ; endMyValue


Thank's for your hints, Kai
 
G

Guest

* kai said:
I use the ConfigPaserver from Python.
how can I use/save/read values with ";" (start comment) and the value
blank?
When I write (set) my config file often the part behind the ";"
disappears.
e.g.
myKey = startMyValue ; endMyValue

You can't. The ConfigParser treats " ;" as inline comment delimiter. This is
undocumented (afaik) and badly hardcoded into the module. The time I found
this out, I simply hacked my own (way more simple) parser module
replacement.

Anyway, you might try http://www.voidspace.org.uk/python/configobj.html
instead. I've never used it myself, though.

nd
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top