ConfigParser and options
cepl at surfbest.net
Thu Feb 13 00:40:36 CET 2003
I would like to write a config file parser, but I would like to allow
set just some options (when he wants a default values for the rest of
them). How can I do it?
I can write something like
for rcvar in rcconfile.options(currsection):
variable = get(currsection,rcvar)
but how do I connect variable to the real variable which is equal to
the name of the option in the file? Other option is to go in one huge
if ... construct
variable1 = rcconfile.get(currsection,'variable1')
variable2 = rcconfile.get(currsection,'variable2')
but it is really ugly, isn't it?
Thanks in advance for any help,
P.S.: Please Cc: to my emaili address -- I am not subscribed.
More information about the Python-list