[ConfigParser] value with ; and the value blank

Larry Bates larry.bates at websafe.com
Fri May 5 19:18:53 CEST 2006


kai wrote:
> Hello,
> 
> 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
> 
No, but you can write it as:

mykey=startMyValue,endMyValure

or use any other separator (~,:, etc.)

mykey=startMyValue~endMyValue

or you could do something like:

startvalue=startMyValue
endvalue=endMyValue

To do what you ask you would have to write something
custom (not recommended unless you don't control the
format of the file).

-Larry Bates



More information about the Python-list mailing list