Skip to content

Commit fbcd181

Browse files
authored
Merge pull request #839 from Prajwol-Shrestha/main
added auto_shutdown
2 parents e0f9b7f + 749c1a6 commit fbcd181

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

auto_shutdown/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# auto_shutdown
2+
3+
Shutdowns device after x minutes
4+
5+
## Built Using os and time modules ( built in )

auto_shutdown/auto_shutdown.py

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

0 commit comments

Comments
 (0)