0

I need to close an .exe at the end of my code. I was able to start the .exe file

proc = subprocess.Popen('.nameProgram.exe')

Now I have to close it but the terminate() function doesn't seem to work. I tried this code:

proc.terminate()

I noticed that the exe executable is under another java process. How can I close it. Do you have any suggestions? Thanks

Harry
  • 13
  • 2

1 Answers1

0

Type

ps

In terminal & check on which name program is runing once you run. copy that name.

#inside python program
import os
os.system('pkill programName')