Recommended "new" way for config files

Peter vmail at mycircuit.org
Thu Jan 7 11:10:05 EST 2010


Hi
There seems to be several strategies to enhance the old ini-style config 
files with real python code, for example:

1) the documentation tool sphinx uses a python file conf.py that is 
exefile(d) , but execfile is suppressed in Python 3
2) there is a module cfgparse on sourceforge that supports a hybrid style
3) modern tools like ipython seems to favor a new style based on python 
code config files but also support a hybrid style mixing .ini files and 
python code files.
4) I could use __import__ to import modules based on some command line 
options


Is there a strategy that should be prefered for new projects ?

thanks
peter



More information about the Python-list mailing list