Create A Screen Awake Loop Program In Python

A small python script to move your mouse, press the shift key, and keep your PC awake when you’re away Uses command line arguments to set the number of minutes between movements and requires Python3 or higher. Default timer is 3 minutes, but can be 1 or more.

I created a screen awake loop code using python. Automation is a term for technology applications where human input is minimized. This includes business process automation (BPA), IT automation, personal applications such as home automation and more.

Install Pyautogui In Python

PyAutoGUI is essentially a Python package that works across Windows, MacOS X and Linux which provides the ability to simulate mouse cursor moves and clicks as well as keyboard button presses.

// for macos
pip3 install pyautogui

// for windows
pip install pyautogui

Doing the same repetitive tasks can be a bit boring. Automating such activities can save us much time and help us to be productive in other areas.

import pyautogui
import time

while True:
    print("app is running")'shift')
    print("pressing shift")

This code will keep your screen awake. Comment If this will work for you or If you getting any error.

Leave a Reply

For News Subscribe Us!

Can curiosity may end shameless explained. True high on said mr on come. An do mr design at little myself wholly entire though. Attended of on stronger or mr pleasure.

You have been successfully Subscribed! Ops! Something went wrong, please try again.

© 2022 Code With AM