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

Re: [pygame] Exiting a program abnormally




On Feb 23, 2005, at 20:12, Kris Schnee wrote:

Chris Smith wrote:
Is there an easy way to abnormally exit from a program using pygame?
Running my code in full-screen, I've had to kill X and then log back
in again - very annoying.
I normally use windowed mode but you have to test in all situations.
Was caught out tonight because I commented out the exit code in my gui
:-(

Part of the solution is: pygame.display.quit()

You can link that to some event like a keypress in your main input loop. I'm not sure how to actually end the program, but if you're desperate you can do a deliberate crash like:
print "The Spanish Inquisition" + 42

If you have another computer around, you can probably ssh in and kill python..


-bob