[Tutor] How to change Windows Environment Variable

dman dsh8290 at rit.edu
Fri Aug 31 02:17:15 CEST 2001


When you ask a new question, just start a new mail, don't reply to a
totally unrelated post.

On Fri, Aug 31, 2001 at 08:43:12AM +0900, ??? wrote:
| Dear all,
| 
| How to change environment variable on Windows NT or 2000 by python?

>>> import os
>>> print os.putenv.__doc__
putenv(key, value) -> None
Change or add an environment variable.
>>> 

You want os.putenv.

Note that it only affects the python process, not any parent processes
(ie a shell).

HTH,
-D





More information about the Python-list mailing list