You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
462 B
17 lines
462 B
"""
|
|
categories: Modules,os
|
|
description: ``environ`` attribute is not implemented
|
|
cause: Unknown
|
|
workaround: Use ``getenv``, ``putenv`` and ``unsetenv``
|
|
"""
|
|
import os
|
|
|
|
try:
|
|
print(os.environ.get("NEW_VARIABLE"))
|
|
os.environ["NEW_VARIABLE"] = "VALUE"
|
|
print(os.environ["NEW_VARIABLE"])
|
|
except AttributeError:
|
|
print("should not get here")
|
|
print(os.getenv("NEW_VARIABLE"))
|
|
os.putenv("NEW_VARIABLE", "VALUE")
|
|
print(os.getenv("NEW_VARIABLE"))
|
|
|