1

When starting a subprocess using Popen and later trying to end it using terminate, it can take over 10 seconds before the subprocess disappears from Windows Task Manager.

p = subprocess.Popen('foo.exe')
while True:
    ...    
    if quitProcess:
        p.terminate()

Question: Is there a quicker way to quit the subprocess, ideally within a second?

jfs
  • 399,953
  • 195
  • 994
  • 1,670
Nyxynyx
  • 61,411
  • 155
  • 482
  • 830

0 Answers0