Python: Get Environment Variable

By Xah Lee. Date: . Last updated: .
# python 3

# get environment variable

import os
print(os.getenv("HOME", "default value if none"))

# /Users/xah

Python

Regex

Text Processing

Web

Misc