I have a python script that will run a batch script. This batch script sets an environment variable say _BLDPATH. I want to grab this variable in the python script to use that variable later on. The problem is that even though the variable gets set properly when the batch file was executed, the os.getenv does not get me the variable back in python script.
How do I get this to work.
snippet of the code is
import os
os.system("bldroott.bat")
bldpath = os.getenv("_BLDPATH")
print "bld path is ",bldpath
snippet of bldroot.bat
REM ....
REM...
if "%_BLDPATH%" == "" goto SET_BLDPATH
goto DONE
:SET_BLDPATH
set _BLDPATH=C:\Bld607
echo %_BLDPATH%
:DONE
The result when I run the above python script is
bld path is None