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

Re: [pygame] Quit pygame



If I'm not mistaken, you have to have an event loop that watches for the
pygame.quit() event.

for event in pygame.event.get():
            if event.type == QUIT:
               running = False

Something like that.

Dan

On Thu, 30 Sep 2010 12:05:26 +0200, Massimo Di Stefano
<massimodisasha@xxxxxxxx> wrote:
> Hello All,
> 
> 
> i'm having a problem with pygame, ... i don't know ho to quit a pygame
> session :-(
> 
> i'm on osx 10.6.4
> from a standard python shell, i'm able to start a pygame session,
running
> : 
> 
> - import pygame ; from pygame.locals import * ; pygame.init()
> 
> 
> MacBook-Pro-15-di-sasha:~ sasha$ python
> Python 2.6.1 (r261:67515, Feb 11 2010, 00:51:29) 
> [GCC 4.2.1 (Apple Inc. build 5646)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import pygame
>>>> from pygame.locals import *
>>>> pygame.init()
> Leopard libedit detected.
> (6, 0)
>>>> 
> 
> 
> the previouse instructions opens a nice pygame icon on my dock 
> the problem is that i don't know how to "quit" it.
> 
> Tyring to stop the pygame session using : 
> 
>  pygame.quit() 
> 
> i have no actions ... pygame is still running and i'm not able to stop
it.
> 
> To quit the pygame session i have to quit the python session itself ...
or
> foce-quit the app (that always will close my python session)
> 
> have you any hints on how to quit a pygame session without the needs of
> exit from python ?
> 
> thanks !
> 
> 
> beste regards,
> 
> Massimo.