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? Can someone please provide me insight on how to do this. Thanks in advance.
I tried to do as follows. I created an environment variable LOCATION_HOME which points to C:\\Documents\\CodeRepo... and then I did file = open("LOCATION_HOME\\codeplay.exe") in python code. It gives error file not found.
import os path = os.environ["LOCATION_HOME"]
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)