[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Starting from IDLE



On Wed, Oct 15, 2003 at 02:45:52PM +0300, Sami Hangaslammi wrote:
> 
> On Wed, 15 Oct 2003, Bo Jangeborg wrote:
> > When I run a pygame program from IDLE (windows IDE) the game window
> > doesn't close when the application stops. I have to press CTRL-ALT-DEL
> > to close the window. Am I missing something ?
> 
> Don't run from IDLE. That's the only solution I can offer. IDLE uses Tk 
> and its event loop messes with pygame events.
> 
> Do the editing in IDLE and run your program from the command line.
> 
> --
> Sami Hangaslammi
>

How about trying this:


try:
    my_stuff_that_uses_pygame()
finally:
    pygame.quit()


That way pygame.quit gets called even when your code crashes.