linux close all running python code example
Example 1: kill all python processes ubuntu
sudo pkill python
sudo pgrep python
Example 2: kill and run process in windows python
import os
os.system("taskkill /im make.exe")
sudo pkill python
sudo pgrep python
import os
os.system("taskkill /im make.exe")