PhotoImage problem

J

jimgardener

hi
I am using Python 2.5.1. In my code i want to use
self.myimage=PhotoImage (file=self.myfile)

so i can create the image in a canvas
self.mycanv.create_image(70,100,image=self.myimg)

it works when i add,
from ImageTk import PhotoImage

but this import caused an error message when i tried to run this in a
friend's linux machine that had python and PIL. Is PhotoImage part of
standard python library?In new versions of python do i have to modify
this import statement in anyway?

thanks
jim
 
G

Guilherme Polo

---------- Forwarded message ----------
From: Guilherme Polo <[email protected]>
Date: Mon, Jun 30, 2008 at 1:00 PM
Subject: Re: PhotoImage problem
To: jimgardener <[email protected]>


hi
I am using Python 2.5.1. In my code i want to use
self.myimage=PhotoImage (file=self.myfile)

so i can create the image in a canvas
self.mycanv.create_image(70,100,image=self.myimg)

it works when i add,
from ImageTk import PhotoImage

but this import caused an error message when i tried to run this in a
friend's linux machine that had python and PIL. Is PhotoImage part of
standard python library?In new versions of python do i have to modify
this import statement in anyway?

PhotoImage is a class in the Tkinter module, so if you have from
Tkinter import * and from ImageTk import PhotoImage it is very
possible that you will have problems.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,678
Members
48,796
Latest member
Greg L.

Latest Threads

Top