"Fredrik Lundh" <[EMAIL PROTECTED]> writes:
> since you know the name of the config file you're looking for, you can
> simplify (and unweirdify) your code a bit by changing your config file to
> look like this:
> 
>     # File: config.py
> 
>     #
>     # configuration defaults
> 
>     some_param = "value"
>     some_other_param = 1
> 
>     #
>     # get user overrides
> 
>     import os
>     try:
>         execfile(os.path.expanduser("~/.program/config.py"))
>     except IOError:
>         pass # ignore missing config file, but not syntax errors
> 
>     # end of file
> 
> with this in place, you just have to do
> 
>     import config
> 
> in any application module than needs to access the configuration
> data.

nice, that looks to be just what I was looking for.  thanks.

-- 
burton samograd                                 kruhft .at. gmail
kruhft.blogspot.com     www.myspace.com/kruhft  metashell.blogspot.com
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to