Python:Environment variables

From wiki
Revision as of 18:42, 3 July 2024 by Hdridder (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Show environment variables
import os
import subprocess

for var, value in os.environ.items():
    print(var, value)

ToDo:

check where this comes in handy:

subprocess.Popen(my_command, env=my_env)