ponty / pyscreenshot

Python screenshot library, replacement for the Pillow ImageGrab module on Linux.
BSD 2-Clause "Simplified" License
499 stars 89 forks source link

dosent write image files! #31

Closed its0x08 closed 7 years ago

its0x08 commented 8 years ago

i tried it like this but the img file is not readable...

import pyscreenshot

if name == "main":

im = pyscreenshot.grab()
ff= open("img.png", "wb")
ff.write(im)
ff.close()
ponty commented 8 years ago

Check the pillow documentation! http://pillow.readthedocs.io/en/3.2.x/reference/Image.html

You can save with: im.save()

import pyscreenshot
im = pyscreenshot.grab()
im.save("img.png")
its0x08 commented 7 years ago

Thank you!