Skip to content

Commit 55be734

Browse files
added auto_shutdown
1 parent 3569c88 commit 55be734

File tree

2 files changed

+22
-0
lines changed

2 files changed

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

0 commit comments

Comments
 (0)