I am trying to create a background running file, and I want the file to open a file, wait for its termination and activate some code after.
I want to open the file in the path /../foo.exe
.
Any help appreciated.
I tried process = subprocess.Popen([f"start {os.path.dirname(__file__)}foo.exe"])
But I got the error message:
Traceback (most recent call last):
File "C:\Users\ORI\Desktop\everything\General stuff\EasyRP-windows\configs\background.py", line 5, in <module>
process = subprocess.Popen([f"start {os.path.dirname(__file__)}foo.exe"]) #\\..\\easyrp.exe"
File "C:\Users\ORI\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 947, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Users\ORI\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 1416, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified