sudo easy_install -f http://www.pythonware.com/PRoducts/pil/ Imaging如果出現(xiàn)錯(cuò)誤,則執(zhí)行命令xcode-select --install,然后重新進(jìn)行上一步,具體錯(cuò)誤如下:/applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/tk.h:78:11: fatal error:
'X11/Xlib.h' file not found
# include <X11/Xlib.h>
再安裝Pillow模塊即可:
sudo pip install -U Pillow測(cè)試抓取屏幕:from PIL import ImageGrabdef grab_image(addr): im = ImageGrab.grab() im.save(addr,"jpeg")if __name__ == "__main__": grab_image("test.jpeg")
新聞熱點(diǎn)
疑難解答
圖片精選
網(wǎng)友關(guān)注