Hello Under WinXP starting a pygame program from command prompt that does not use the pygame.quit() function will hang while quitting! Well documentation sais: I do not know, why it will hang under WinXP (startet at command prompt)? Inserting the line "pygame.quit()" does the trick. ~DR0ID #-------------Example 1------------------------------------------------- while 1: for event in pygame.event.get(): print "event" if event.type == pygame.QUIT: sys.exit() if event.type == pygame.KEYDOWN and event.key == pygame.KEY_ESCAPE: sys.exit() #-------------Example 2------------------------------------------------- while 1: for event in pygame.event.get(): print "event" if event.type == pygame.QUIT: return if event.type == pygame.KEYDOWN and event.key == pygame.KEY_ESCAPE: return #-------------Example 3------------------------------------------------- looping = True while looping: for event in pygame.event.get(): print "event" if event.type == pygame.QUIT: looping = False if event.type == pygame.KEYDOWN and event.key == pygame.KEY_ESCAPE: looping = False #------------------------------------------------------------------------ I think it is not a bad idea to clean up at the end. I use a variable to control the loop. In that way I can be sure to catch all exit paths: #-------------------------------------------------------------- looping = True while looping: for event in pygame.event.get(): print "event" if event.type == pygame.QUIT: looping = False if event.type == pygame.KEYDOWN and event.key == pygame.KEY_ESCAPE: looping = False # single exit path, clean up your stuff or do whatever needed pygame.quit() #-------------------------------------------------------------- |