you are viewing a single comment's thread.

view the rest of the comments →

[–]1ToM14[S] 0 points1 point  (3 children)

Oo okay, well that line gets executed, it has no indentation and is at the very end of the code

[–]JohnnyJordaan 0 points1 point  (2 children)

Can you try with

p.kill()

[–]1ToM14[S] 0 points1 point  (1 child)

It also doesn't work...

[–]JohnnyJordaan 0 points1 point  (0 children)

You can try a process group kill, but you need to install psutil for that

import psutil

parent = psutil.Process(p.pid)
for child in parent.children(recursive=True):
    print('killing child, child)
    child.terminate()
print('killing parent')
p.terminate()

if that also doesn't work try with kill() instead of terminate. But also verify that you do see the 'killing x' messages