Answers for "python program to shutdown computer when user is not present"

1

python program to shutdown computer when user is not present

import mouse
import time
import os
while True:
    before_sleep = mouse.get_position()
    time.sleep(600)#depends on you
    after_sleep = mouse.get_position()
    if before_sleep == after_sleep:
        os.system("shutdown /s /t 1")
#you can make your own detection to find if user is using keyboard
Posted by: Guest on October-01-2021

Code answers related to "python program to shutdown computer when user is not present"

Python Answers by Framework

Browse Popular Code Answers by Language