Environmental Variables

Diez B. Roggisch deets at nospam.web.de
Mon Mar 13 05:47:41 EST 2006


Sathyaish wrote:

> In which physical file are the python environmental variables located?
> I know I can access them using the:
> 
> 
> os.environ.get('PYTHONSTARTUP')
> 
> or
> 
> os.environ.get('PYTHONPATH')
> 
> 
> to get their values. But out of the program, if I need to look at them
> and alter their values, where do I find them? Are they the OS
> environmental variables as I suspect? If they are, then I'll find them
> with the other OS environ variables in My
> Computer->System->Properties->Advanced->Environmental Variables.
> 
> But I checked that place and did not find any default values for them.

They aren't necessarily stored somewhere - except in memory. You can open a
cmd-prompt and do something like

set FOO "bar" 

(syntax may vary, I'm a UNIX-guy)

Then you will be able to access this variable from a process - like python.
But it is nowhere saved.

Diez



More information about the Python-list mailing list