I'm using tkinter to animate a gif using guidance from the following pages: Tkinter animation will not work
However I cannot get the suggestions to work. Right now I have something like this
import tkinter as tk
root = tk.Tk()
frames = [tk.PhotoImage(file = '/home/quantik/Pictures/dice.gif',format="gif -index %i" %(i)) for i in range(5)]
def animate(n):
if (n < len(frames)):
label.configure(image=frames[n])
n+=1
root.after(300, animate(n))
label = tk.Label(root)
label.pack()
root.after(0, animate(0))
root.mainloop()
However it just displays the last image in frames
I've tried several methods but I keep getting the same result. Does anyone have any suggestions as to why this may be happening?