Reading/Writing Config Files

Paramjit Oberoi p_s_oberoi at hotmail.com
Thu Aug 21 15:31:03 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.

2. pylibini (http://3dfx4ever.oltrelinux.com/projects/pylibini/)
For the last several months, the web page has said, "Please do
NOT download the current version of pylibini. In few days time
a new version pylibini with lots of new features and big fixes
will be released."  It looks pretty good otherwise, but if the
developers themselves don't want me to use it...

3. FLAD (http://phd.pp.ru/Software/Python/):  Satisfies all my
requirements, but the code dates back to 1997, and the API isn't
very pythonic, I think.

Are there other libraries I should look at?  Should I just write
one myself (or clean up [2] or [3]) ?  I can't believe there isn't
something better available for such a common task...

Thanks,
-param




More information about the Python-list mailing list