title: How to display specific gif based on key press event using Pyglet?
body: <p>Code I got so far</p>
  <pre><code>import pyglet
  from pyglet.window import key
   
   
  
  animation = pyglet.image.load_animation('/home/arctic/Downloads/work/gif/ErrorToSurprised.gif')
  
  animSprite = pyglet.sprite.Sprite(animation)
  
  w = animSprite.width
  h = animSprite.height
   
  window = pyglet.window.Window(width=w, height=h, resizable=True)
   
   
  @window.event
  def on_key_press(symbol, modifiers):
      if symbol == key.A:
          animation = pyglet.image.load_animation('image1.gif')
   
      elif symbol == key.B:
          animation = pyglet.image.load_animation('image2.gif')
   
      elif symbol == key.ENTER:
          print(&quot;Enter Key Was Pressed&quot;)
   
   
   
  @window.event
  def on_draw():
      window.clear()
   
   
   
  pyglet.app.run()
  </code></pre>
  <p>This yields an error, i dont think im loading in the gif correctly under elif symbol==key. This function display a window default gif. Then listening to a key press, depending on the key display a certain gif</p>