It's really incredible ... All are proposing some special package for playing an animated GIF, at the moment that it can be done with Tkinter and the classic PIL module!
Here is my own GIF animation method (I created a while ago). Very simple:
from Tkinter import * from PIL import Image, ImageTk from time import sleep def stop(event): global play play = False exit() root = Tk() root.bind("<Key>", stop) # Press any key to stop GIFfile = {path_to_your_GIF_file} im = Image.open(GIFfile); img = ImageTk.PhotoImage(im) delay = float(im.info['duration'])/1000; # Delay used in the GIF file lbl = Label(image=img); lbl.pack() # Create a label where to display images play = True; frame = 0 while play: sleep(delay); frame += 1 try: im.seek(frame); img = ImageTk.PhotoImage(im) lbl.config(image=img); root.update() # Show the new frame/image except EOFError: frame = 0 # Restart root.mainloop() You can set your own means to stop the animation. Let me know if you like to get the full version with play/pause/quit buttons.
Note: I am not sure if the consecutive frames are read from memory or from the file (disk). In the second case it would be more efficient if they all read at once and saved into an array (list). (I'm not so interested to find out! :)