python program to keep your computer awake

Solutions on MaxInterview for python program to keep your computer awake by the best coders in the world

showing results for - "python program to keep your computer awake"
Elio
03 Nov 2016
1import time
2import mouse
3import random
4while True:
5    get_position_of_mouse = mouse.get_position()
6    time.sleep(10)
7    new_position = mouse.get_position()
8    go_to = random.randint(10,300)
9    if get_position_of_mouse == new_position:
10       mouse.move(go_to,go_to)
11#if you know how to check if the user is typing something but not using mouse you can 
12#add that feature also