jpeg files displayed in a loop

Wolfgang Teschner wtr at hannover.sgh-net.de
Tue Dec 11 15:45:42 EST 2001


Hello, Kevin,
thank you very much for your long example!
I should try that immediately (well, now I seem to have even TWO ways
of doing it!).
It looks promising!

Thank you all,
wolfgang

On 11 Dec 2001 12:03:19 -0800, kevin at cazabon.com (Kevin Cazabon)
wrote:

>import Tkinter
>import Image, ImageTk
>import os
>
>dir="c:\\temp\\"
>
>
>def showimage():
>    image = pop(files)
>    files.append(image)
>    image = ImageTk.photoimage(Image.open(image)) #ok, do try/except
>    b.configure(image=image)
>    b.update_idletasks()
>    b.after(1000, showimage)
>
>a = Tkinter.tk()
>b = Tkinter.label(a)
>b.pack()
>
>files = os.listdir(dir) # ok, check them for file types...
>while 1:
>    showimage()
>
>
>
># ok, probably a couple minor typos, but it should be that simple.
>
>Kevin Cazabon.
>kevin at cazabon.com
>
>
>Wolfgang Teschner <wtr at hannover.sgh-net.de> wrote in message news:<rp8a1u82me3g8v8ievtfjve9llbodq6rau at 4ax.com>...
>> Hi,
>> I want to automatically display all jpeg files of a dir in a long
>> loop, with a wait time between the different displays. Just that.
>> No user input.
>> With PIL, it seems to be impossible because of TKinters mainloop.
>> 
>> Are there other ways/packages for this purpose? Just displaying the
>> images as they are...
>> platform is win32, but I would be interested for independant
>> solutions, if they exist.
>> 
>> Thanks,
>> wolfgang teschner




More information about the Python-list mailing list