Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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.