[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] pygame.quit()
- To: pygame-users@xxxxxxxx
 
- Subject: Re: [pygame] pygame.quit()
 
- From: Luke Paireepinart <rabidpoobear@xxxxxxxxx>
 
- Date: Mon, 31 Jul 2006 15:21:08 -0500
 
- Delivered-to: archiver@seul.org
 
- Delivered-to: pygame-users-outgoing@seul.org
 
- Delivered-to: pygame-users@seul.org
 
- Delivery-date: Mon, 31 Jul 2006 16:21:13 -0400
 
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws;        s=beta; d=gmail.com;        h=received:message-id:date:from:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding;        b=qGv43Ltduj+sCMpnEAVTOStjqi1mKjqqeIlq18fZWjd4PTGW5H3SoGp+mv4yzl72d1OJcM+fBvQ795wENp26+7yMYz2MDk2v3/YEfPv5/hN2aFzK4OY6twGTSN2s8iZ35E86zVepIEev2V/BLRshdBMr5PI5LstDTC3UHh9qHb8=
 
- In-reply-to: <44CE310C.405@bluewin.ch>
 
- References: <44CE310C.405@bluewin.ch>
 
- Reply-to: pygame-users@xxxxxxxx
 
- Sender: owner-pygame-users@xxxxxxxx
 
- User-agent: Thunderbird 1.5.0.5 (Windows/20060719)
 
DR0ID wrote:
Hello
Under WinXP starting a pygame program from command prompt that does 
not use the pygame.quit() function will hang while quitting! 
It works fine for me.
Well documentation sais:
Uninitialize all pygame modules that have previously been 
initialized. When the Python interpreter shuts down, this method is 
called regardless, so your program should not need it, except when it 
wants to terminate its pygame resources and continue. It is safe to 
call this function more than once: repeated calls have no effect.
Note, that pygame.quit will not exit your program. Consider letting 
your program end in the same way a normal python program will end.
I do not know, why it will hang under WinXP (startet at command 
prompt)? Inserting the line "pygame.quit()" does the trick.
it doesn't for me.
What version of WinXP, what version of Python, and what version of 
Pygame are you using?
I'm using python 2.4.2 pygame 1.7 on winXP professional.
[snip code]
you meant K_ESCAPE not KEY_ESCAPE.
I used the following code:
#---- start
import pygame
pygame.display.init()
scr = pygame.display.set_mode((640,480))
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
#---- end
Whenever I run it from a command prompt, it closes the pygame window and 
gives me the prompt back
whenever I press escape or click the X.  What makes you think it's hanging?
Hope we get this figured out.
-Luke