There seems to be a standard utility called screencapture
on the Mac, you could use subprocess
to call that, like so:
from subprocess import call
call(["screencapture", "screenshot.jpg"])
There are options to screencapture
to specify a specific rectangle as well:
$ screencapture -h
. . .
-R<x,y,w,h> capture screen rect