[Tutor] Bitmaps and TK

Rick Pasotto rickp@telocity.com
Wed Dec 4 14:08:02 2002


On Wed, Dec 04, 2002 at 03:32:48PM -0000, Ian Dickinson wrote:
> I am farly new to this Python / Tk thing
> 
> but I just cannot get a full colour picture to appear on a canvas at an X,Y position specified by me
> 
> Image.open does not appear to exist
> 
> Fredrik Lundh Introduction to Tkinter seems to be completly wrong
> 
> The documentation for PIL seems to be very bad and the things in it don't work
> 
> Anyway here is my code
> 
> 
> import Image
> from Tkinter import *

One thing you might want to check into is reversing these two
statements. Evidently Tkinter has an Image module that does not include 
an open method. So:

>>> from Tkinter import *
>>> import Image
>>> 
>>> im = Image.open("imagefile.jpg")

now works.

One of the hazards of 'from xxx import *'.

-- 
"Drawing on my fine command of language, I said nothing."
		-- Mark Twain
    Rick Pasotto    rickp@telocity.com    http://www.niof.net