#! 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")
Ce que je veux faire est que si la capture d'écran ne correspond pas à ce qui est actuellement sur mon écran, il va faire une action. im en cours d'exécution sur les fumées iciPython automation avec pyautogui si les instructions ne sont pas exécutées
Donc, pour tout dire, vous avez tout à fait raison. j'ai manqué l'indentation mais elle n'a jamais montré une erreur parce que la syntaxe était correcte. Merci! – John
Je suis content que c'était la solution! – AetherUnbound