PyGame, window is not closing, tut not helping

JL informfr at gmail.com
Mon May 12 21:26:55 EDT 2008


If the game runs normally without IDLE, then, to run it from IDLE, add
pygame.quit() at the end of the script:

if __name__ == "__main__":
    MainWindow = PyManMain()
    MainWindow.MainLoop()
    pygame.quit()

... and just before the sys.exit():

    def MainLoop(self):
        """This is the Main Loop of the Game"""
        while 1:
            for event in pygame.event.get():
                if event.type == pygame.QUIT:
                    pygame.quit()
                    sys.exit()



More information about the Python-list mailing list