Set env and run command
import os
os.system("echo hello")
os.system("echo $HOME")
os.system("echo Before $MY_TEST")
os.environ['MY_TEST'] = 'qqrq'
os.system("echo After $MY_TEST")
We can change the environment variables and that change will be visible in subprocesses, but once we exit from ou Python program, the change will not persist.