reading a config file

s99999999s2003 at yahoo.com s99999999s2003 at yahoo.com
Thu Nov 3 22:02:00 EST 2005


hi
i used ConfigParser to read a config file. I need the config file to
have identical sections. ie :

[server]
blah = "some server"
[destination]
blah = "some destination"
[end]
end= ''

[server]
blah = "some other server"
[destination]
blah = "some other destination"
[end]
end=''

and i need to check that every 'server' and 'destination' is followed
by 'end'

if i used the 'sections' method, it always show 'server' and
'destination' and 'end'. how can i iterate all the sections. ie..

for s in cfg.sections():
  do something...

or is naming all the sections with different names is a better option?
thanks




More information about the Python-list mailing list