[Tutor] Displaying picture and Text

patty at cruzio.com patty at cruzio.com
Thu Nov 4 05:24:00 CET 2010


Hi - I am running Python 2.6.6 on my HP netbook with Windows 7. The 
default picture viewer is set to HP Photo Viewer.  I am working on a part
of my python program where a picture is supposed to display with a few
lines of text below it.  Ideally, I would like this to stay on the screen
for  a short  period of time (2 minutes?) but I am using raw_input() for
now.

I imported the Image library and when I run the program below, it brings
up a window (stdout or python?) with cursor flashing for a few seconds and
then the HP Photo Viewer comes up with the picture, I close this window
and then my text comes up in a python window.

import Image

fhdl = Image.open("C:\Users\StarShip\PyProgs\\bbsparkle.gif")
fhdl.show()
print "here is some test text test text test text"
print "here is some more test text test text test text"
print "here is even more of some test text test text test text"

raw_input("press any key to continue")

How do I get any picture to display on half a screen then my print text
display below that and stay on screen for 2 or 3 minutes before I call
another function that will redraw the screen anyway - it will be
interactive text responses with the user.  Also this is a test .gif file,
I may want to just edit the source file and change this to a .jpg.

I don't want to change the system defaults for this, maybe for the picture
itself if that is necessary.

Thanks

Patty



More information about the Tutor mailing list