PIL Headaches: Advice Needed

Bengt Richter bokr at oz.net
Mon Mar 18 20:00:32 EST 2002


On 18 Mar 2002 08:58:11 -0800, mnations at airmail.net (Marc) wrote:

>This is the main error that I am seeing:
>
>
>...
>File "play2_copy.py", line 90, in createWidgets
>  im = "Image.open("cs.bmp")
        ^--??
I that from real code or what are you posting?

>File "C:\Python22\lib\Image.py", line 960 in open
>IOError: cannot identify image file
>
>
>I have tried this with .gif, .jpg, and a couple of others and none of
>the file types are recognized. Here is the code where the image is
>imported:
>
>canvas = Canvas(goFrame, width=400, height=400)
>	im = Image.open("cs.bmp")
>	im.show()
>	canvas.pack()
>
Funny indentation. That's not how it really looks, right?

>What am I doing wrong?
>
I doesn't look like you are posting actual code or
verbatim lines from an interactive session.

Since you can interactively walk through suspicious code one statement at
a time and look at the results, why don't you do that? Then if it isn't
obvious, post a verbatim copy of the failing interaction.

You can copy from the windows console window by Alt-SpaceBar>E>K then select the text block
with the mouse by pressing with the left mouse button with the cursor on the first character
and keeping the left button pressed while moving the cursor to the bottom right to make a block
that encloses what you want, and then pressing Enter. That will put it in the clipboard.
Then paste into your news reader message editor.

HTH!

Regards,
Bengt Richter





More information about the Python-list mailing list