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
  • 374,366
  • 172
  • 933
  • 1,594
Nyxynyx
  • 56,949
  • 141
  • 437
  • 770

0 Answers0