0

I need to run a few batch files that setup a lot of environment variables and paths. Then I run my application that requires those environment variables and paths to be specified. If I am doing this on DOS it is as simple as running these batch files in series and then running my command. But I need to wrap this up in python. Once the Popen() call for setup.bat is done, the next Popen() call with my command does not find this environment. How do I solve this problem other than recreating all the environment manually in the python script?

The problem specifically for me is I need to run the compiler setup batch files (like Intel and Visual Studio) and then run make that uses these compilers on windows.

Thanks, -Sachin

Sachin Myneni
  • 273
  • 3
  • 14
  • possible duplicate of https://stackoverflow.com/questions/5469301/run-a-bat-file-using-python-code – Vincent Rodomista Oct 04 '18 at 02:44
  • @VincentRodomista : I don't believe this is a duplicate. That question seems to deal with simply running a BATCH file from python. I want to be able to carry the environment variables set within 1 batch file, called by my python script, through to the remaining part of my script (after the batch file had finished execution) – Sachin Myneni Dec 21 '18 at 20:36

0 Answers0