Configuration recommendations

Ville Vainio vvainio at tp.spt.fi
Mon Jun 10 10:24:55 EDT 2002


"Stuart D. Gathman" <stuart at bmsi.com> wrote in message news:<adra81$qf9$1 at nntp2-cm.news.eni.net>...
> I have an application - of the background daemon variety - written in
> python.  It has some configuration data like the following:

...

> What is standard practice for incorporating such data?  I would like it


I do it like this:

import new
config = new.module("config")
sys.modules['config'] = config

execfile('./mykillerapp.cfg',config.__dict__)


And then use the vars via the config module.

-- Ville



More information about the Python-list mailing list