saving settings

Ten runlevelten at gmail.com
Wed May 31 05:17:26 EDT 2006


On Monday 29 May 2006 12:28, SuperHik wrote:
> aum wrote:
> > On Mon, 29 May 2006 09:05:36 +0200, SuperHik wrote:
> >> Hi,
> >>
> >> I was wondering how to make a single .exe file, say some kind od clock,
> >> and be able to save some settings (alarm for example) into the same
> >> file? Basically make code rewrite it self...
> >>
> >> thanks!
> >
> > Yikes!!!
> >
> > I'd strongly suggest you read the doco for ConfigParser, and load/save
> > your config file to/from os.path.join(os.path.expanduser("~")).
> >
> > Another option - save your stuff in the Windows Registry
>
> but if I copy this file on the other computer settings will be lost...

A pretty standard behaviour in this context is to have your program create
its own config file if it's absent, say on first run, per user, or if it's 
copied to a new machine.

Just do it using whatever defaults are in the python file itself.

Regards,

Ten.
-- 
There are 10 types of people in this world,
those who understand binary, and those who don't.



More information about the Python-list mailing list