well this is why I suggested pyglet over pygame, AFAIK in pygame you have an update method just like in pyglet but it needs to be inherited from a sprite object this is a sample I found on the net,
python code:
class Fist(pygame.sprite.Sprite):
"""moves a clenched fist on the screen, following the mouse"""
def __init__(self):
pygame.sprite.Sprite.__init__(self) #call Sprite initializer
self.image, self.rect = load_image('fist.bmp', -1)
self.punching = 0
def update(self):
"move the fist based on the mouse position"
pos = pygame.mouse.get_pos()
self.rect.midtop = pos
if self.punching:
self.rect.move_ip(5, 10)
so the problem with the code you currently have is the while True loop, and while it seems natural that that should work, it doesn't seem to work in pygame or even pyglet for that matter.
To rectify this I would create a sprite object and put your key test in the update method similar to what we did in pyglet. Were there any advantages for pygame over pyglet? When I was informed about which one to use I was told pygame might be easier but pyglet is definitely more feature rich, unless it is expected that you use pygame, you might like to consider sticking to pyglet that is if you have the choice.