.bat files and path in python(subprocess | sys)

Xristos Xristoou saxri89 at gmail.com
Tue May 24 16:52:15 EDT 2016


hello

i use some programs where support python api.
but to can use that api from programs need to define some paths(pythonpath program and more) and call some batch files(if i not do that i cant access api support).create an .bat file where if i run i can use api.

mybatch.bat
set ROOT=C:\path\path
call “%ROOT%“\path1\path1.bat
call “%ROOT%“\path2\path2\path2\etc\path2.bat
set GDPATH=%OSGEO4W_ROOT%\path3\path3
path %PATH%;”%OSGEO4W_ROOT%\path\Python27\Scripts\”
set PYTHONPATH=%PYTHONPATH%;%ROOT%\path4\path4\python;
set PYTHONPATH=%PYTHONPATH%;%ROOT%\path5\Python27\Lib\site-packages
set SPATH=%ROOT%\path6
start “name ide” /B “path from idle.exe” 

but i can use api only from this file i dont want that

i want to create a script where to run or call batch file with the |subprocess | and run on background(activate).
and i need define path with the |sys|,sys.path.extend,sys.path.append i am not sure who is right.




More information about the Python-list mailing list