ID EN
OS

getenv

Python 3.11

Return the value of the environment variable key as a string if it exists, or default if it doesn’t. key is a string. Note that since getenv() uses os.environ, the mapping of getenv() is similarly also captured on import, and the function may not reflect future environment changes.

Syntax

PYTHON
os.getenv(key, default=None)

See Also

getenv() os.environ getenv() sys.getfilesystemencoding() os.getenvb() Availability