@@ -0,0 +1,503 @@
+#!/usr/bin/env python%0A%0A%22%22%22%0AKill a process by name.%0A%22%22%22%0A%0Aimport os%0Aimport sys%0Aimport psutil%0A%0Adef main():%0A    if len(sys.argv) != 2:%0A        sys.exit('usage: %25s name' %25 __file__)%0A    else:%0A        NAME = sys.argv%5B1%5D%0A%0A    killed = %5B%5D%0A    for proc in psutil.process_iter():%0A        if proc.name == NAME and proc.pid != os.getpid():%0A            proc.kill()%0A            killed.append(proc.pid)%0A    if not killed:%0A        sys.exit('%25s: no process found' %25 NAME)%0A    else:%0A        sys.exit(0)%0A%0Asys.exit(main())%0A

add killall.py example script