473,395 Members | 1,452 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

PhotoImage problem

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
Jun 30 '08 #1
1 1793
---------- Forwarded message ----------
From: Guilherme Polo <gg****@gmail.com>
Date: Mon, Jun 30, 2008 at 1:00 PM
Subject: Re: PhotoImage problem
To: jimgardener <ji*********@gmail.com>
On Mon, Jun 30, 2008 at 12:02 PM, jimgardener <ji*********@gmail.comwrote:
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.
>
thanks
jim
--
http://mail.python.org/mailman/listinfo/python-list

--
-- Guilherme H. Polo Goncalves
Jun 30 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Mark 'Kamikaze' Hughes | last post by:
In the new Python game I'm developing, I need to crop out individual tiles from larger tilesets, and maintain transparency. Unfortunately, I've run into major deficiencies in both Tkinter and PIL...
1
by: Gregor Lingl | last post by:
Hi all, The Tkinter PhotoImage Widget can be set to "transparent" with the method blank(). Moreover the color of single pixels or definite regions can be set with method put. I'd like to...
1
by: Harlin Seritt | last post by:
Why is that I can only get the PhotoImage class to show up when I write a straight procedural script (no object orientation) but not when I try to use object-orientation? These two scripts in...
0
by: Adonis | last post by:
I have two classes one class inherits dict(), this class just takes in a path argument much like glob.glob() and loads the image using PhotoImage into itself, no biggie works fine. The other class...
117
by: Peter Olcott | last post by:
www.halting-problem.com
2
by: vm | last post by:
please help! I can't find anything wrong (except the result ofc ;-) This: picfile = 'logo.gif'
0
by: shadowsithe | last post by:
I can't seem to find a way to convert an Image.Tk PhotoImage to a PIL Image so that I can use the save function.
2
by: =?iso-8859-1?q?C=E9dric_Lucantis?= | last post by:
Hi, I can only load gif images with Tkinter.PhotoImage and none with BitmapImage. I tried png, jpg, bmp and xpm and always got this errors : Traceback (most recent call last): File...
1
by: harryos | last post by:
hi i am trying to display an image on a canvas in a gui made with Tkinter widgets class PhotoDisplay: def __init__(self,parent): self.mainframe = Frame(parent,background="grey") ........
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.