#! python3 import pyautogui import time pyautogui.screenshot('first.png') #take a SS of my entire screen check = pyautogui.locateCenterOnScreen('first.png');# set the value of check to center of screen assuming it will be the same as the SS...it will print(check); #(960, 540) is the center of my screen and is stored in check while True:#inf loop pyautogui.screenshot('Test.png')#take a second Screenshot idleout = pyautogui.locateCenterOnScreen('Test.png');#set the value of idleout with the center of test.jpg print(idleout); #(960, 540) is the center suprised?? if idleout != check:#idleout != (960, 540) then this should happen pyautogui.press('space');#space is never pressed or any action taken ive even tried with print("hello") what i want to happen is if the screen shot does not match what is currently on my screen it will do some action. im running on fumes here
mercredi 3 mai 2017
Python automation with pyautogui if statements wont execute
Inscription à :
Publier les commentaires (Atom)
Aucun commentaire:
Enregistrer un commentaire