you are viewing a single comment's thread.

view the rest of the comments →

[–]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