title: Play Animations in GIF with Tkinter
body: <p>I've been trying to play an animated gif using <code>Tkinter.PhotoImage</code>, but haven't been seeing any success. It displays the image, but not the animation. The following is my code:</p>
  
  <pre><code>root = Tkinter.Tk()
  photo = Tkinter.PhotoImage(file = "path/to/image.gif")
  label = Tkinter.Label(image = photo)
  label.pack()
  root.mainloop()
  </code></pre>
  
  <p>It displays the image in a window, and that's it. I'm thinking that the issue has something to do with <code>Tkinter.Label</code> but I'm not sure. I've looked for solutions but they all tell me to use PIL (Python Imaging Library), and it's something that I don't want to use. </p>
  
  <p>With the answer, I created some more code (which still doesn't work...), here it is:</p>
  
  <pre><code>from Tkinter import *
  
  def run_animation():
      while True:
          try:
              global photo
              global frame
              global label
              photo = PhotoImage(
                  file = photo_path,
                  format = "gif - {}".format(frame)
                  )
  
              label.configure(image = nextframe)
  
              frame = frame + 1
  
          except Exception:
              frame = 1
              break
  
  root = Tk()
  photo_path = "/users/zinedine/downloads/091.gif"
  
  photo = PhotoImage(
      file = photo_path,
      )
  label = Label(
      image = photo
      )
  animate = Button(
      root,
      text = "animate",
      command = run_animation
      )
  
  label.pack()
  animate.pack()
  
  root.mainloop()
  </code></pre>
  
  <p>Thanks for everything! :)</p>