Saving parameters between Python applications?

Stodge stodge at gmail.com
Wed Sep 19 20:43:25 EDT 2007


I wrote a small C program in Linux and used setenv() from stdlib and
it modified the console's environment. I can also modify the console's
environment from a DOS batch file, so why not in Python?

Guess I'm inexperienced and I just don't get it. :)

On Sep 18, 11:48 am, Steve Holden <st... at holdenweb.com> wrote:
> Stodge wrote:
> > 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.
>
> That's a sign of your inexperience, then. As someone has already pointed
> out, this is nothing to do with Python.
>
> Under UNIX/Linux you could use the $$ variable to construct a filename
> specific to a particular shell process and put it in the environment,
> but I'm not aware of a similar feature in Windows. This is probably a
> sign of *my* inexperience :-)
>
> > 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.
>
> You might be able to write a Python program to access it :-)
>
> regards
>   Steve
> --
> Steve Holden        +1 571 484 6266   +1 800 494 3119
> Holden Web LLC/Ltd          http://www.holdenweb.com
> Skype: holdenweb      http://del.icio.us/steve.holden
>
> Sorry, the dog ate my .sigline





More information about the Python-list mailing list