config files in python

Michael Ströder michael at stroeder.com
Mon May 5 03:35:10 EDT 2008


sandipm wrote:
>  In my application, I have some configurable information which is used
> by different processes. currently I have stored configration in a
> conf.py file as name=value pairs, and I am importing conf.py file to
> use this variable. it works well
> 
> import conf
> print conf.SomeVariable
> 
> but if I need to change some configuration parameteres,  it would need
> me to restart processes.

reload(conf)

http://docs.python.org/lib/built-in-funcs.html#l2h-61

But you should carefully consider what updating the configuration means 
in your application.

Ciao, Michael.



More information about the Python-list mailing list