How to integrate a batch script that sets environment variables with a python script (3.7)?
问题 I am running a python script that uses environment variables from a batch file. The variables are lost after the script is called. Here is an example of the code (example.py): subprocess.Popen(env.cmd, shell=True).wait() ENV_HOME = str(os.environ["ENV_HOME"]) I'm getting KeyError because ENV_HOME is not defined. I understand that I can use os.environ to set environment variables for my scripts to work, but env.cmd is a very large file that sets a lot of paths that I need for the python