ConfigParser shootout, preliminary entry

WakeBdr bbull at pathfire.com
Wed Oct 20 16:39:57 EDT 2004


So, I've been working on this a little yesterday and today and I've got
something that I like so far.  I just thought about a "feature" and I'd
like to get some opinions on it.  Should the ConfigParser object be
able to read and store configs from multiple config files or should
each config file require a new ConfigParser object?

If the ConfigParser object could read and store multiple files, I see
referencing it like so

# Load the config files
cpObj.load(file0)
cpObj.load(file1)

# get values from them
ret0 = cpObj.file0.property0
ret1 = cpObj.file1.property0

where file0 and file1 can be whatever you would like to name them.  I
ask this because I like to put a lot of information in config files
making my code as configurable as possible.  Sometimes, managing the
config file can be as messy as managing the code itself.  So, breaking
the config files up into several smaller files may be handy.
Any thoughts on this?




More information about the Python-list mailing list