This repository was archived by the owner on Nov 30, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Failed to load files.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
Script added for restart and shutdown pc using python

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
# Imprort OS library
import os

# User input
option = int(input("""
Enter input
[1] Shutdown
[2] Restart
[3] Quit
"""))

# Function for shutting down pc
def shutdown():
os.system('shutdown -s')

# Function for restarting pc
def restart():
os.system("shutdown /r /t 1")

if(option == 1):
shutdown()
elif(option == 2):
restart()

else:
exit()