Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Pyautogui.displayMousePosition()

Im having issues with pyautogui.

pyautogui.displayMousePosition()
Press Ctrl-C to quit.
Traceback (most recent call last):
  File "<pyshell#3>", line 1, in <module>
    pyautogui.displayMousePosition()
  File "C:\Users\maxwe\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyautogui\__init__.py", line 1759, in displayMousePosition
    pixelColor = pyscreeze.screenshot().getpixel(
NameError: name 'pyscreeze' is not defined

I’ve done research on pyscreeze and i don’t know what the issue is, everything should be installed correctly and pyautogui does work in some cases

pyautogui.displayMousePosition
<function displayMousePosition at 0x000001D6E8C95760>

both with "import pyautogui"
Im just tryna figure out my mouse position so i can write a program with clicking, am i doing anything wrong?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

I’m assuming you’re trying to get a screenshot instead of real-time coordinates printed to console. For that you can try:

import pyautogui
pyautogui.mouseInfo()
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading