问题
I want to get the color of pixels on the screen in Python3.x. (example x,y) I work on windows. and using tkinter. But, It can't use PIL in Python 3.x.
How can i do this. Thank you.
回答1:
You can use PIL on Python3.x; there is a binary installer for Windows. The code might not work as is both on Python2.x and Python3.x:
try: import Image # Python 2.x
except ImportError:
from PIL import Image # Python 3.x
You could capture an area of the screen using an analog of grab() method.
来源:https://stackoverflow.com/questions/9130982/getting-the-color-of-pixels-on-the-screen-in-python3-x