title: Play an Animated GIF in python with tkinter
body: <p>I am wanting to create a virtual pet style game using python3 and tkinter.  So far I have the main window and have started putting labels in, but the issue I am having is playing an animated gif.  I have searched on here and have found some answers, but they keep throwing errors. The result I found has the index position of the gif using PhotoImage continue through a certain range.</p>
  
  <pre><code>    # Loop through the index of the animated gif
  frame2 = [PhotoImage(file='images/ball-1.gif', format = 'gif -index %i' %i) for i in range(100)]
  
  def update(ind):
  
      frame = frame2[ind]
      ind += 1
      img.configure(image=frame)
      ms.after(100, update, ind)
  
  img = Label(ms)
  img.place(x=250, y=250, anchor="center")
  
  ms.after(0, update, 0)
  ms.mainloop()
  </code></pre>
  
  <p>When I run this in terminal with "pyhton3 main.py" I get the following error:</p>
  
  <blockquote>
    <p>_tkinter.TclError: no image data for this index</p>
  </blockquote>
  
  <p>What am I overlooking or completely leaving out?</p>
  
  <p>Here is the link to the GitHub repository to see the full project:<a href="https://github.com/nmoore14/first_python/tree/master/VirtPet_Python" rel="noreferrer">VirtPet_Python</a></p>
  
  <p>Thanks in advance!</p>