Python-skript för att stoppa Windows applikationer/avstängning dator
# Program som stoppar vanliga Windows-program och stänga av datorn
# För verkligen lata. :-)
skriva ut ("stoppa program nu")
# importera modulen operativsystem
# Tillåt förbrukaren till springa operativsystemkommandon från Python
importera os
# Kör kommandot "taskkill" för att stoppa program i Windows
OS.system ("taskkill /f /im notepad.exe")
OS.system ("taskkill f im winword.exe")
OS.system ("taskkill f im excel.exe")
OS.system ("taskkill f im powerpnt.exe")
OS.system ("taskkill f im outlook.exe")
OS.system ("taskkill f im chrome.exe")
OS.system ("taskkill f im calc.exe")
OS.system ("taskkill f im iexplore.exe")
OS.system ("taskkill f im powershell.exe")
OS.system ("taskkill f im wordpad.exe")
# använda mallen nedan för att lägga till fler program
# os.system ("taskkill f im [körbara namn] .exe")
# avstängning datorn i 1 sekund
OS.system ("shutdown/s/t 1")