import os os.system("shutdown /s") #shutdown #or os.system("shutdown /r") #restart #maybe os.system("shutdown /l") #logoff #or maybe... os.system("shutdown /h") #hibernate #for a full list, go into Command Prompt and type "shutdown"