Don't try to modify your environment, instead modify your program.
import sys from subprocess import Popen proc = Popen([sys.executable, "your_script.py"]) return_value = proc.wait() # this call blocks until the program has been finishedDon't use
os.system
, it's deprecated since years.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
All humans together. We don't need politicians!