pythonic way of making a config module

skip at pobox.com skip at pobox.com
Wed Jan 18 11:17:46 EST 2006


    andrew> I'm working on an app that will be deployed on several different
    andrew> servers.  In each case, I'll want to change some config info (database
    andrew> name, paths, etc.)

    andrew> In perl, I would have done something like this:
    ...
    andrew> What is a pythonic equivalent? 

Take a look at the ConfigParser module.  It reads and writes Windows-style
INI files.  Also, you can do something similar to what you do in Perl.  It's
just that you import the config data from the places that need it instead of
exporting it from the place it's defined.

Skip



More information about the Python-list mailing list