ID EN
OS Path

expandvars

Python 3.11

Return the argument with environment variables expanded. Substrings of the form $name or ${name} are replaced by the value of environment variable name. Malformed variable names and references to non-existing variables are left unchanged.

Syntax

PYTHON
os.path.expandvars(path)

See Also

path-like object