import ImageGrab fails on Ubuntu 10.4

News123 news1234 at free.fr
Sun Oct 31 12:11:58 EDT 2010


On 10/31/2010 05:04 PM, News123 wrote:

> importing ImageGrab un Ubuntu 10.4 fails as seen below:
> 
>     import _grabscreen
> ImportError: No module named _grabscreen
> 


Well I found a partial answer on
http://www.pythonware.com/library/pil/handbook/imagegrab.htm

> 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 Windows only.


I just wonder why there is no cleaerer  message like

"platform not supported"


As a workaround I use now:

    cmd = "import -window root %s" % fname
    os.system(cmd)
    img = Image.open(fname)

using the 'import' command of the ImageMagick tool kit

Is there any other way to make screen shots in Linux, ideally without
creating an intermediate file



More information about the Python-list mailing list