Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #a python script to kill process by its name
- # kill_process.py
- import os, signal
- def check_kill_process(pstring):
- for line in os.popen("ps ax | grep " + pstring + " | grep -v grep"):
- fields = line.split()
- pid = fields[0]
- os.kill(int(pid), signal.SIGKILL)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement