Reading/Writing Config Files

Tony Meyer ta-meyer at ihug.co.nz
Thu Aug 21 18:00:18 EDT 2003


> I need to read/write config files that will be updated by
> both users as well as programs.  All config-file modules
> that I have looked at so far aren't completely satisfactory:
> 
> 1. ConfigParser: does not preserve order of entries in the 
> config file and comments when updating the file.  This is 
> critical since people are going to be reading/updating those 
> files as well.

You might also want to read the python-dev thread about ConfigParser from
the start of the year:
<http://aspn.activestate.com/ASPN/Mail/Message/python-dev/1483518>

(I don't know what happened to the ability to make 'surgical' changes that
was proposed, since google doesn't seem to have anything further than that
thread, and I don't read python-dev.  I gather that some improvements were
checked in and then backed out, though, so you might even find your solution
in the Python cvs history around the start of the year).

Or this one from way back in 1999:
<http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&frame=right&th=
b3ce51a18f20ea42&seekm=14082.39956.781534.266164%40weyr.cnri.reston.va.us#li
nk1>

=Tony Meyer






More information about the Python-list mailing list