Saving parameters between Python applications?

Stodge stodge at
Tue Sep 18 15:36:09 CEST 2007

os.path.expanduser isn't an option; I need each console/window to
maintain different values which I wouldn't get from saving to a user's
home directory. Unless I used a different file for each console/window
but that just gets me into the same situation I'm already in. I think
the only option is to set environment variables using another script.
I'm really surprised and disapponited by this.

One option I thought of but haven't investigated, is the ability to
get the parent (i.e. console's) process id and use that to create a
file somewhere. Not sure if this is even possible.

On Sep 17, 4:29 pm, bryanjugglercryptograp... at wrote:
> On Sep 17, 6:39 am, Laurent Pointal
> > May use simple file in known place:
> > $HOME/.myprefs
> > $HOME/.conf/myprefs
> > Or host specific configuration API:
> > WindowsRegistry HKEY_CURRENT_USER\Software\MySociety\MyApp\myprefs
> > See os.getenv, and _winreg Windows specific module.
> > See also standard ConfigParser module
> Also, os.path offers expanduser(). The following is reasonably
> portable:
>     import os
>     user_home_dir = os.path.expanduser("~")
> --
> --Bryan

More information about the Python-list mailing list