asweigart / pyautogui

A cross-platform GUI automation Python module for human beings. Used to programmatically control the mouse & keyboard.
BSD 3-Clause "New" or "Revised" License
10.47k stars 1.27k forks source link

Bug with calling locateCenterOnScreen in a loop #883

Open forsthetwo opened 2 months ago

forsthetwo commented 2 months ago

This library has some bugs When I call the locateCenterOnScreen function in a loop like the following, it takes longer and longer each time I loop, note that the two calls recognize different images

import pyautogui
for i in range(10):
    a=pyautogui.locateCenterOnScreen('a.png')
    b=pyautogui.locateCenterOnScreen('b.png')

The version of the library I'm using is 0.9.54