Posts

Showing posts from July, 2022

How to make Ms Teams status always show as Available

One way is to automatically generate keystroke in a regular interval so your computer will never go into sleep. import pyautogui import time value = True while (value): #infinite loop pyautogui.press('left') # press the left arrow key time.sleep(60) #wait 60 seconds For more info, check out https://pyautogui.readthedocs.io/en/latest/keyboard.html

How to know or track something change on screen

Have you ever wanted to have a tool or program to automatically take screenshots at regular interval and compare them? With just a few lines of codes, Python can help! import pyautogui import time import winsound value = True while (value): #infinite loop img1 = pyautogui . screenshot ( region = ( 0 , 0 , 300 , 400 )) #take 1st screenshot time.sleep(30) #wait 30 seconds img2 = pyautogui . screenshot ( region = ( 0 , 0 , 300 , 400 )) #take 2nd screenshot if img1 != img2: #compare and if 1st and 2nd screenshot are different winsound.Beep(440, 1000) #play sound pyautogui.alert("Something changed") #alert box For more info on PyAutoGUI screenshot function, check out  https://pyautogui.readthedocs.io/en/latest/screenshot.html You might want to consider adding keystrokes at regular interval, then check out  https://pyautogui.readthedocs.io/en/latest/keyboard.html