os.putenv(key, value)
Set the environment variable named key to the string value. Such changes to the environment affect subprocesses started with os.system()
, popen()
or fork()
and execv()
.
Availability: most flavors of Unix, Windows.
Note
On some platforms, including FreeBSD and Mac OS X, setting environ
may cause memory leaks. Refer to the system documentation for putenv.
When putenv()
is supported, assignments to items in os.environ
are automatically translated into corresponding calls to putenv()
; however, calls to putenv()
don’t update os.environ
, so it is actually preferable to assign to items of os.environ
.
Please login to continue.