Python 截屏模塊:pyscreenshot
pyscreenshot 是一個 Python 的模塊,用來對屏幕進行截屏并拷貝到 PIL or Pillow 圖像對象中。這是一個純 Python 庫,支持跨平臺。
示例代碼:
import pyscreenshot as ImageGrabfullscreen
im=ImageGrab.grab() im.show()
part of the screen
im=ImageGrab.grab(bbox=(10,10,510,510)) # X1,Y1,X2,Y2 im.show()</pre>
Ubuntu 下安裝:
sudo apt-get install python-pip sudo pip install pyscreenshot sudo apt-get install python-imagingoptional back-ends
sudo apt-get install scrot sudo apt-get install imagemagick sudo apt-get install python-gtk2 sudo apt-get install python-qt4
optional for examples
sudo pip install entrypoint2</pre>
卸載:
# as root pip uninstall pyscreenshot項目主頁:http://www.baiduhome.net/lib/view/home/1420341786578
本文由用戶 g6d7 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!