0
Q:

shutdown/restart windows with python

import os

os.system("shutdown /s /t 1")
4
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
#you can also put:
f"shutdown /{thing} /t {time you want until the action}"
#for a full list, go into Command Prompt and type "shutdown"
3

import os


os.system("shutdown /s /t 1")
1

New to Communities?

Join the community