Killing a process created with Python’s subprocess.Popen() [duplicate]

In your code it should be

proc1.kill()

Both kill or terminate are methods of the Popen object. On macOS and Linux, kill sends the signal signal.SIGKILL to the process and terminate sends signal.SIGTERM. On Windows they both call Windows’ TerminateProcess() function.

Leave a Comment