Skip to main content

Restart System in Python

 





import os

restart = input("Do you want to restart your pc (Y/N)")
if restart =="y":
    os.system("shutdown /r /t 5")
else:
    exit()



Comments