Merge pull request #96 from Prajwol-Shrestha/master

added Scheduled_shutdown script
This commit is contained in:
Advaita Saha 2022-10-04 09:57:01 +05:30 committed by GitHub
commit b4f1195419
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 0 deletions

View 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`

View 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()