ConfigParser module and alternatives (flad, flan)

Pavlos Christoforou pchristo at ic.sunysb.edu
Tue Apr 13 13:46:17 EDT 1999


On Sat, 10 Apr 1999, Mike Orr wrote:

> I use ConfigParser to parse the data files in a Mad Lib CGI program.
> See it at http://mso.oz.net/python/madbibs/
> (When I add/change a story, I run a script that parses the files,
> creates the HTML, and stores the preprocessed data structures in a 
> cPickle file for the CGI script.)

Sounds like you might benefit from Zope, or at least ZPublisher.


> 
> I'm not sure if I'll use ConfigParser for the next version.  I don't
> really need the sections (multiple files work just fine, using the filename
> for the section name), and I haven't found a use for the the %(other_key)s
> substitutions.  On the other hand, it doesn't handle multiple values (the
> same key repeated within a record), which I sometimes need.

Last time I needed to use configuration files I wrote an XML module that
maps XML files onto python dictionaries. Changes to either the python
dictionary during run-time or to the file are synchronized automatically
(not good for huge configuration files that are modified frequently). The
standard python distribution comes with a good XML parser so you can do
pretty cool things. Mapping onto dictionaries creates the same problem
that you mentioned (no multiple values withing the same sectrion
(dictionary)). If anyone is interested I can send her/him a copy.

Pavlos





More information about the Python-list mailing list