Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

kill os system by pid python script

processList = (process for process in psutil.process_iter() if process.name()=="chrome.exe")
    totalProcess = sum(1 for x in processList)
    print(totalProcess)
    processList = (process for process in psutil.process_iter() if process.name()=="chrome.exe")
    for (i, x) in enumerate(processList):
        print(x)
        if (i > 1 and i <= 3):
            os.kill(x.pid, 9)
            print(i)
            print(x)
 
PREVIOUS NEXT
Tagged: #kill #os #system #pid #python #script
ADD COMMENT
Topic
Name
2+5 =