I have been implementing pyautogui.pixel in many forms of code, I will get a normal desirable output for a random short while, and at some point, the function will stop working, and I will get error messages.
Simple example code:
while True:
print(pyautogui.pixel(1766, 1539))
Output:
(30, 30, 30)
The eventual error message:
Traceback (most recent call last):
File "c:\Users\zyoli\Desktop\scrap_bot\gathering.py", line 14, in <module>
print(pyautogui.pixel(1766, 1539))
File "C:\Users\zyoli\AppData\Local\Programs\Python\Python39\lib\site-packages\pyscreeze\__init__.py", line 584, in pixel
return (r, g, b)
File "C:\Users\zyoli\AppData\Local\Programs\Python\Python39\lib\contextlib.py", line 124, in __exit__
next(self.gen)
File "C:\Users\zyoli\AppData\Local\Programs\Python\Python39\lib\site-packages\pyscreeze\__init__.py", line 113, in __win32_openDC
raise WindowsError("windll.user32.ReleaseDC failed : return 0")
OSError: windll.user32.ReleaseDC failed : return 0