PIL Open Problem

Richard Holmes richardh at dslextreme.com
Tue Feb 8 00:09:24 CET 2011

On Mon, 07 Feb 2011 17:28:45 -0500, Corey Richardson <kb1pkl at aim.com>

>On 02/07/2011 05:27 PM, Richard Holmes wrote:
>> I'm trying to create an image for use in Tkinter. If I understand the
>> PIL documentation correctly, I first need to import Image, then
>> create an instance of the Image class and call 'open'
>Don't do that. This is wrong:
>import Image
>im = Image.Image()
>im = im.open(foo)
>This is good:
>import Image
>im = Image.open(foo)
Uh, thanks, Corey, but that's what I'm doing. See Traceback:

Traceback (most recent call last):
  File "todo.py", line 202, in <module>
    im = Image.open(cwd + r'\delete.GIF', 'r')
AttributeError: class Image has no attribute 'open'

More information about the Python-list mailing list