Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

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
Comment

PREVIOUS NEXT
Code Example
Python :: python how to read a xlsx file 
Python :: max of two columns pandas 
Python :: remove first row of dataframe 
Python :: python capitalize each word 
Python :: rotate x label 90 degrees seaborn 
Python :: python remove cached package 
Python :: tensorflow mnist dataset import 
Python :: pretty print pandas dataframe 
Python :: wait until clickable selenium python 
Python :: show rows with a null value pandas 
Python :: join list with comma python 
Python :: python add zero to string 
Python :: python app to deb 
Python :: check string similarity python 
Python :: python code to convert all keys of dict into lowercase 
Python :: return maximum of three values in python 
Python :: python roman to integer 
Python :: how to disable help command discord.py 
Python :: python remove empty string from list 
Python :: generate python date list 
Python :: html to json python 
Python :: tkfiledialog python 3 example 
Python :: correlation matrix python 
Python :: python iterate dictionary key value 
Python :: between date pandas 
Python :: suffixes in pandas 
Python :: python beautifulsoup write to file 
Python :: python copy a 2D list 
Python :: how to remove coma in python 
Python :: plt line of best fit 
ADD CONTENT
Topic
Content
Source link
Name
8+2 =