How to change Windows Environment Variable

Tim Peters tim.one at home.com
Fri Aug 31 01:52:49 EDT 2001


[???]
> Thanks quick reply. But not set to OS.
> I would like to set and using while login windows.
>
> >>>Import os

Here I get suspicious, on two counts:  there's no space between the prompt
and your import, and Python is case-sensitive so "Import os" would have
given a SyntaxError.  Both of those tell me you're not pasting what you
actually did, and that makes it hard to take anything that follows at face
value either.

> >>>os.environ['Test'] = 'Hello '
> >>>print 'Test key in this?=', os.environ.has_key('Test')
> Test key in this?= 0

Here's an actual copy-and-paste:

>>> import os
>>> os.environ['Test'] = 'Hello '
>>> print 'Test key in this?=', os.environ.has_key('Test')
Test key in this?= 1
>>>

Worked fine.





More information about the Python-list mailing list