I forgot the orignal intent of the poster, but
I'll point out just in case that setting the environment in this
way will only effect the environment of the current python
process or any programs spawned by it - it won't effect
the environment of other programs while it's running or
in the future. Not sure if that's really the intended effect.
Standard behavior, but I've seen people make this mistake.
m
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Tim
Peters
Sent: Thursday, August 30, 2001 10:53 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: How to change Windows Environment Variable
[???]
> 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.
_______________________________________________
ActivePython mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activepython
_______________________________________________
ActivePython mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activepython