How to call an executable file as an independent process using python in windows

After calling exe using a python script on Windows, exe should run independently of this python script, and after it starts, the control should return to the python script and execute further script and control the .py file will die . But on the other hand, before completing the execution, exe must call this python script.

Ideas will be greatly appreciated.

I tried the following commands:

  • os.system("start test.exe")
  • os.startfile("test.exe")
  • os.spawnlv(os.P_NOWAIT, "test.exe")
  • os.spawnv(os.P_NOWAIT, 'C:\Python31\python.exe', ('python', 'test.py'))
  • os.execvp("python3", ("test.py", ))
+3
source share
1 answer

, , ( :) Python 3.1, , . , (exe .)

+1

Source: https://habr.com/ru/post/1765073/


All Articles