Burton Samograd wrote:
> Hi, 
> 
> I'm writing an app that stores some user configuration variables in a
> file ~/.program/config, which it then imports like so:
> 
>         import sys
>         from posix import environ
>         sys.path.append(environ["HOME"]+"/.program")
>         import config
> 
> I can then access the configuration through code like:
> 
>         login(config.username)
> 
> My question is, how can I setup my program defaults so that they can
> be overwritten by the configuration variables in the user file (and so

You could use the ConfigParser module instead of putting your config in 
a Python module. ConfigParser allows specifying defaults.

Kent
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to