<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.6036" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Thank you! I was getting confused, I thought
I wouldn't need Tkinter. I thought Tkinter is yet another addon library
besides PIL. Am I right or wrong? So I actually need both? And
this brings me back to my _other_ question which is that as individuals go
about downloading these addon libraries and their doc, how do you organize this
on your computer system? I can imagine that in corporations there
are guidelines for this, but I am wondering what you all do? You could end up
with addon libraries, doc and Readmes all over your hard disk</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Patty</FONT></DIV>
<BLOCKQUOTE dir=ltr
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=waynejwerner@gmail.com href="mailto:waynejwerner@gmail.com">Wayne
Werner</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=patty@cruzio.com
href="mailto:patty@cruzio.com">Patty</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Cc:</B> <A title=tutor@python.org
href="mailto:tutor@python.org">tutor@python.org</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Saturday, November 06, 2010 7:16
AM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [Tutor] Displaying Pictures
& Text</DIV>
<DIV><BR></DIV>
<DIV class=gmail_quote>On Fri, Nov 5, 2010 at 11:53 PM, Patty <SPAN
dir=ltr><<A href="mailto:patty@cruzio.com">patty@cruzio.com</A>></SPAN>
wrote:<BR>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<DIV bgcolor="#ffffff">
<DIV><FONT face=Arial size=2>
<DIV>Hi Alan - </DIV>
<DIV> </DIV>
<DIV>I tried using ImageTk from the PIL library to display jpegs (and
hopefully any picture type) instead of just gif as you suggested
below. I read online that these these types of
programs should
<DIV>be run from executables not in the interpreter but it crashes and I
can't read the error. Here is the program:</DIV>
<DIV> </DIV>
<DIV>import Image<BR>import ImageTk</DIV>
<DIV> </DIV>
<DIV>fhdl =
Image.open("C:\Users\StarShip\PyProgs\SuitGirl.jpg")<BR>ImageTk.PhotoImage(fhdl)</DIV></DIV></FONT></DIV></DIV></BLOCKQUOTE>
<DIV><BR></DIV>
<DIV>Before you convert to an ImageTk, you need to first create a toplevel
window:</DIV>
<DIV><BR></DIV>
<DIV>import Image</DIV>
<DIV>import ImageTk</DIV>
<DIV>import Tkinter as tk</DIV>
<DIV><BR></DIV>
<DIV>root = tk.Tk()</DIV>
<DIV>#put your code here</DIV>
<DIV><BR></DIV>
<DIV>And that should work. You'll still have to add the widgets and what-nots
so you can present your image, but in order to create an image with ImageTk,
you need to have a toplevel window created.</DIV>
<DIV><BR></DIV>
<DIV>That's what this is telling you</DIV>
<DIV>
<DIV><FONT class=Apple-style-span face=Arial><BR></FONT></DIV>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">Traceback
(most recent call last):</BLOCKQUOTE>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid"> File
"<stdin>", line 1, in <module></BLOCKQUOTE>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid"> File
"C:\Python26\lib\site-packages\PIL\ImageTk.py", line 113, in
__init__</BLOCKQUOTE>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
self.__photo = apply(Tkinter.PhotoImage, (), kw)</BLOCKQUOTE>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid"> File
"C:\Python26\lib\lib-tk\Tkinter.py", line 3285, in __init__</BLOCKQUOTE>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
Image.__init__(self, 'photo', name, cnf, master, **kw)</BLOCKQUOTE>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid"> File
"C:\Python26\lib\lib-tk\Tkinter.py", line 3226, in __init__</BLOCKQUOTE>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
raise RuntimeError, 'Too early to create image'</BLOCKQUOTE>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">RuntimeError:
Too early to create image</BLOCKQUOTE>
<DIV><FONT class=Apple-style-span face=Arial><BR></FONT></DIV></DIV>
<DIV><BR></DIV>
<DIV>HTH,</DIV>
<DIV>Wayne</DIV>
<DIV> </DIV></DIV></BLOCKQUOTE></BODY></HTML>