os.getenv()

os.getenv(key, default=None)[source]

Get an environment variable, return None if it doesn’t exist. The optional second argument can specify an alternate default.