Ubuntu 導入IMageGrab 出錯,解決方法

	from PIL  import ImageGrab

功能:ImageGrab模塊能將屏幕或剪切板的內容複製到PIL圖像內存。
The ImageGrab module can be used to copy the contents of the screen or the clipboard to a PIL image memory.
問題:The current version works on macOS and Windows only.
解決方法:使用pyscreenshot庫,它是Linux系統的ImageGrab替代品

    import pyscreenshot as ImageGrab

參考博客:
http://www.pythonheidong.com/blog/article/145595/
https://pillow.readthedocs.io/en/stable/reference/ImageGrab.html

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章