title: Animation - pygame.time.wait()
body: <p>My code isn't working and I don't understand it why, I'm working with module PYGAME and I want do a animation (three images) when I push the key "<strong>s</strong>". My code is this:</p>
  
  <pre><code>import pygame, sys
  from pygame.locals import *
  from time import *
  
  pygame.init()
  ventana = pygame.display.set_mode((400,300))
  pygame.display.set_caption("Hi!")
  imgA = pygame.image.load("IMG/fan_azul.png")
  imgB = pygame.image.load("IMG/fan_naranja.png")
  imgC = pygame.image.load("IMG/fan_rojo.png")
  listaImg = [imgA,imgB,imgC]
  POS,aux,e = 0,1,0
  picture = listaImg[POS]
  posX,posY,fondo = 200,100,(50,50,50)
  
  while True:
      ventana.fill(fondo)
      #ventana.blit(picture,(posX,posY))
      for evento in pygame.event.get():
              if evento.type == QUIT:
                  pygame.quit()
                  sys.exit()
              elif evento.type == KEYDOWN:
                  if evento.key == K_s:
                      for e in range(0,3):
                          POS = e
                          picture = listaImg[POS]
                          ventana.blit(picture,(posX,posY))
                          print "TIEMPO MEDIDO: "+str(POS)
                          pygame.time.wait(1000)
  pygame.display.update()
  </code></pre>