Как выполнить пакетный файл windows с помощью переменной среды в Python?
Hi, I am working on a python code and require to open an executable which is located in my C drive. I dont want to code something like, file = open("C:\\Documents\\CodeRepo...\\codeplay.exe) I want to use the environment variable called LOCATION_HOME to point to this exe location. I dont know when do i set this environment variable. Do i set it in my python code or using the terminal in Windows?
I am still having some issues. The thing is I provide some extra things in the Popen like shown below. output = subprocess.Popen(('path -testroot C:\\....\Configuration -projectfile ProjectFilewithTags -environment' ), stdout=subprocess.PIPE).stdout What I have tried: <pre> As of now, I did <pre>path = os.environ["LOCATION_HOME"] path += "\\binaries\\codeplay.exe" + "-testroot C:\\....\Configuration -projectfile ProjectFilewithTags -environment".
Я РАСПЕЧАТЫВАЮ ПУТЬ НА PYTHON, И ОН ВЫГЛЯДИТ ПРАВИЛЬНЫМ. но когда я делаю открытие файла в output =.... система не может найти файл.
выход = подпроцесс.Popen ((путь
), stdout=подпроцесс.Трубы).стандартный вывод