Python: Use mouse to draw a rectangle around objects in any window? Also store start and end coordinates as variables relative to said window?
问题 I'm very new to Python and need an approach for accomplishing an important function I've done before in macro-scripting languages: I have a Python program that will be processing a screengrab image using pyscreenshot. In order to feed pyscreenshot the necessary x1, y1, x2, y2 coordinates to create the image, I need the user to define the portion of the screen by drawing a rectangle around it. Think "snipping" tool in Windows and cmd+shift+4 in OSX. I am open to using any BSD module necessary