Set environment variables on the fly
examples/os/show_env.py
import os print(os.environ.get('MYNAME')) print(os.getenv('MYNAME'))
- On Linux and macOS:
MYNAME=Foo python examples/os/show_env.py
import os print(os.environ.get('MYNAME')) print(os.getenv('MYNAME'))
MYNAME=Foo python examples/os/show_env.py