Python:Environment variables

From wiki
Revision as of 12:27, 26 November 2021 by Hdridder (talk | contribs) (Created page with "<syntaxhighlight lang=python> import os import subprocess env = os.environ.copy() for var in env: print(var,env[var] </syntaxhighlight> ToDo: check where this commes in...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
import os
import subprocess

env = os.environ.copy()
for var in env:
    print(var,env[var]

ToDo:

check where this commes in handy:

subprocess.Popen(my_command, env=my_env)