I understand that using import os os._exit(0) will pause the code, but I would like to kill terminal completely, as if I were clicking on the button shaped like a trash can.
Is there any way to do this so I can put it inside my python code?
>Solution :
It’s hacky and won’t work inside a Python subprocess, but it works in a basic sense:
import os
ppid = os.getppid()
os.system("taskkill /f /pid " + str(ppid))