I think locateCenterOnScreen is broken
See original GitHub issuedef locateCenterOnScreen(image, **kwargs):
coords = locateOnScreen(image, **kwargs)
return center(coords)
and
def center(coords):
return Point(coords[0] + int(coords[2] / 2), coords[1] + int(coords[3] / 2))
when image is not found. Then an error occurs:
File "C:\Users\Yasin\PycharmProjects\venv\lib\site-packages\pyscreeze\__init__.py", line 333, in locateCenterOnScreen return center(coords) File "C:\Users\Yasin\PycharmProjects\venv\lib\site-packages\pyscreeze\__init__.py", line 448, in center return Point(coords[0] + int(coords[2] / 2), coords[1] + int(coords[3] / 2)) TypeError: 'NoneType' object is not subscriptable
Issue Analytics
- State:
- Created 4 years ago
- Comments:7
Top Results From Across the Web
pyautogui.locateCenterOnScreen() returns None instead of ...
My problem is Solved when I took screenshot by pyautogui inbuilt function rather than taking WIN + Printscr because if we took screenshot...
Read more >Pyautogui LocateOnScreen not working - Python Help
I tried creating a program where when you run the program it opens a new tab This is my program: import pyautogui as...
Read more >Python Code not working outside of PyCharm - Reddit
locatecenteronscreen, works. for some reason it wont click the located center on screen, unless its in pycharm, is it possible for me to...
Read more >pyautogui.locateOnScreen producing error - Python Forum
I'm thinking its probably an error with my math to calculate xregion , yregion , length , and height .
Read more >pyautogui multiple monitors
locateCenterOnScreen () is also affected if you change your screen size in your system ... I guess you have opencv3.0+ and python3 installed...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@yasinalp Thank you and best wishes!
Yes! Define those functions and use findCenterOnScreen instead locateCenterOnScreen 😃 findCenterOnScreen should have the same arguments with locateCenterOnScreen.