title: Python: Use mouse to draw a rectangle around objects in any window? Also store start and end coordinates as variables relative to said window?
body: <p>I'm very new to Python and need an approach for accomplishing an important function I've done before in macro-scripting languages:</p>
  
  <p>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.  </p>
  
  <p>I am open to using any BSD module necessary but I need module support for OSX and Windows.  </p>
  
  <p>Every example I've found is for how to draw a rectangle within a canvas or on an existing image file.  These examples don't help me because I need the coordinates to be drawn-over and relative to any OS window the user chooses.</p>
  
  <p>Thanks so much for the help!!!</p>
  
  <p>Looked at tutorials to draw rectangles in opencv, pyautogui, tkinter but all drew the rectangles over a window or canvas drawn by the program, not the OS.</p>