Create A Screen Awake Loop Program In Python

Create A Screen Awake Loop Program In Python

Share It With Your Firends:

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")
    pyautogui.press('shift')
    print("pressing shift")
    time.sleep(40)

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

Share It With Your Friends

Leave a Reply

Recent Posts

  • All Post
  • A.I.
  • AI
  • c
  • c++
  • computer
  • cryptocurrency
  • database
  • digital marketing
  • finance
  • hacking
  • HTML
  • java
  • Marketing
  • network
  • other
  • programming
  • python
  • react
  • social
  • Tools
  • Uncategorized
  • web devlopment
    •   Back
    • drawing In Python
DIY AI Voice Assistant In Python

September 8, 2023

Build your own AI assistant with Python! Learn to recognize voice commands, generate responses, and more. Create your virtual companion…

share it

Recent Posts

  • All Post
  • A.I.
  • AI
  • c
  • c++
  • computer
  • cryptocurrency
  • database
  • digital marketing
  • finance
  • hacking
  • HTML
  • java
  • Marketing
  • network
  • other
  • programming
  • python
  • react
  • social
  • Tools
  • Uncategorized
  • web devlopment
    •   Back
    • drawing In Python

Additional Content

CodeWithAM

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus luctus.

Products

Automated Chatbot

Data Security

Virtual Reality

Communication

Support

Services

FAQ's

Privacy Policy

Terms & Condition

Team

Contact Us

Company

About Us

Services

Features

Our Pricing

Latest News

© 2023 Codewitham