jpeg files displayed in a loop

Fernando Pérez fperez528 at
Mon Dec 10 09:24:33 EST 2001

Kevin Cazabon wrote:
> # ok, probably a couple minor typos, but it should be that simple.

Well, you got me curious. Here is the code with some things corrected. This 
actually runs, but it hangs at the first image. My cpu usage pegged at 100% 
and I just had to kill the job, it wasn't going anywhere. Any ideas?

#!/usr/bin/env python

import Tkinter
import Image, ImageTk
import os

dir = "/usr/local/home/fperez/local/python/jpegs"

def showimage():
    image = files.pop()
    image = ImageTk.PhotoImage( #ok, do try/except
    b.after(1000, showimage)

a = Tkinter.Tk()
b = Tkinter.Label(a)

files = os.listdir(dir) # ok, check them for file types...
while 1:

More information about the Python-list mailing list