Skip to content

Commit 4f90cab

Browse files
Merge pull request Mayank94043626#94 from Prajwol-Shrestha/master
added auto shutdown
2 parents ca7c491 + 021570a commit 4f90cab

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

Projects/Auto_shutdown/shutdown.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import os
2+
import time
3+
4+
5+
def shutdown():
6+
os.system("shutdown /s /t 1")
7+
8+
set_time = input("Shutdown After ----> ")
9+
set_time = int(set_time)
10+
11+
sec = 60
12+
13+
print('Computer Will Now Shutdown in ' + str(set_time) + ' Minutes')
14+
time.sleep(set_time*sec)
15+
print('\n')
16+
print('Computer Will Now Shutdown!')
17+
time.sleep(3)
18+
shutdown()

0 commit comments

Comments
 (0)