Screenshot from a user's mouse input with python
<p>So i want to implement a global and partial screenshot tool (like snipping tool in Windows) with python. I want user to input the area that he wants to screenshot with mouse. I can use pyscreenshot module but how can i manipulate the input on :</p>

<pre><code>im=ImageGrab.grab(bbox=(10,10,510,510)) # X1,Y1,X2,Y2
</code></pre>

<p>in the example given?</p>

<p>p.s. <a href="https://github.com/ponty/pyscreenshot" rel="nofollow">https://github.com/ponty/pyscreenshot</a> module's repository</p>

<p>You could do something like</p>

<pre><code>cursor = X.NONE
self.window.grab_pointer(1,X.PointerMotionMask|X.ButtonReleaseMask|X.ButtonPressMask,X.GrabModeAsync, X.GrabModeAsync, X.NONE, cursor, X.CurrentTime)
</code></pre>

<p>See a complete example <a href="https://gist.github.com/initbrain/6628609" rel="nofollow">here</a> </p>

python screenshot