Python - Environment variable

Card Puncher Data Processing

Management

Get

import os
print(os.environ) # all
print(os.environ['HOME']) # one with the array
print(os.environ.get("SOME_PARAMETER", "default_value")) # One with the get function

Set

import os
os.environ["ENV_NAME"] = "value"







Share this page:
Follow us:
Task Runner