title: Animating gif in wxPython
body: <p>I'm trying to animate a gif using wx-Python (2.7). The code listed below works but i want to create a function that animates the gif for me, so i can use it elsewhere. I've tried searching the internet but i can only find code that animates the gif within the <code>__init__</code> function. Any ideas?</p>
  
  <pre><code># -*- coding: cp1252 -*-
  import wx
  import wx.animate
  class MyPanel(wx.Panel):
      def __init__(self, parent, id):
          wx.Panel.__init__(self, parent, id)
          self.SetBackgroundColour("black")
          gif_fname = "skYmk.gif"
          gif = wx.animate.GIFAnimationCtrl(self, id, gif_fname, pos=(10, 10))
          gif.GetPlayer().UseBackgroundColour(True)
          gif.Play()
  app = wx.PySimpleApp()
  frame = wx.Frame(None, -1, "wx.animate.GIFAnimationCtrl()", size = (200, 220))
  MyPanel(frame, -1)
  frame.Show(True)
  app.MainLoop()
  </code></pre>