kill python process in python code example
Example 1: python kill script
import sys
sys.exit()
Example 2: kill and run process in windows python
import os
os.system("taskkill /im make.exe")
Example 3: kill python
pkill -9 python
import sys
sys.exit()
import os
os.system("taskkill /im make.exe")
pkill -9 python