pyscreenshot是一个Python的模块,用来对屏幕进行截屏并拷贝到PILorPillow图像对象中。这是一个纯Python库,支持跨平台。
示例代码:
import pyscreenshot as ImageGrab# fullscreenim=ImageGrab.grab()im.show()# part of the screenim=ImageGrab.grab(bbox=(10,10,510,510)) # X1,Y1,X2,Y2im.show()Ubuntu下安装:
sudo apt-get install python-pipsudo pip install pyscreenshotsudo apt-get install python-imaging# optional back-endssudo apt-get install scrotsudo apt-get install imagemagicksudo apt-get install python-gtk2sudo apt-get install python-qt4# optional for examplessudo pip install entrypoint2卸载:
# as rootpip uninstall pyscreenshot类似的项目还有:
gtkShots
autopy
评论