python psutil

import psutil

PROCNAME = "python.exe"

for proc in psutil.process_iter():
    if proc.name == PROCNAME:
        proc.kill()

你可能感兴趣的:(python psutil)