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

Re: [pygame] IDLE crashes on error?



morgan@xxxxxxxxxxx wrote:
Hi folks,

Python/Pygame newbie here. Really liking it so far, but I've resorted to using Notepad. It seems like any time I execute code with errors in it -- simple syntax errors, not endless while loops or anything -- IDLE freezes. Also, and I don't know if this is related, but sys.exit() doesn't actually close my windows when I'm running things from IDLE. They just freeze.

IDLE version 1.1.3, Python version 2.4.3, any help/advice appreciated.

-Morgan

I've actually had little trouble with IDLE, and usually use it for testing. (On WinXP.) Simple errors like syntax errors don't freeze IDLE; instead it just prints a red error message. This can be a problem occasionally with Pygame programs, because the graphics window obscures the console window and prevents me from seeing that message. So, for testing I try to avoid using fullscreen, and place the window where I can see any error message.


Another thing you can try is to put a "raise" statement (eg. 'raise "An error!"') or breakpoint (some funky key combination), or a try/except block.

try:
	print "forty-two" + 42
except:
	print "Hmm, I'm too strongly-typed to do that."


Kris