mirror of
https://github.com/metafy-social/python-scripts.git
synced 2025-03-01 19:38:42 +00:00
Merge pull request #96 from Prajwol-Shrestha/master
added Scheduled_shutdown script
This commit is contained in:
commit
b4f1195419
11
scripts/Scheduled_Shutdown/README.md
Normal file
11
scripts/Scheduled_Shutdown/README.md
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
## Scheleduled Shutdown files ADDED #83
|
||||||
|
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
Built-in modules ( os and time )
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
Shutdowns PC after X minutes
|
||||||
|
|
||||||
|
- Clone the repo
|
||||||
|
- run `python shutdown.py`
|
17
scripts/Scheduled_Shutdown/shutdown.py
Normal file
17
scripts/Scheduled_Shutdown/shutdown.py
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
import os
|
||||||
|
import time
|
||||||
|
|
||||||
|
def shutdown():
|
||||||
|
os.system("shutdown /s /t 1")
|
||||||
|
|
||||||
|
set_time = input("Shutdown After ----> ")
|
||||||
|
set_time = int(set_time)
|
||||||
|
|
||||||
|
sec = 60
|
||||||
|
|
||||||
|
print('Computer Will Now Shutdown in ' + str(set_time) + ' Minutes')
|
||||||
|
time.sleep(set_time*sec)
|
||||||
|
print('\n')
|
||||||
|
print('Computer Will Now Shutdown!')
|
||||||
|
time.sleep(3)
|
||||||
|
shutdown()
|
Loading…
x
Reference in New Issue
Block a user