[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] Detect errors in fuctions
On Wed, Jun 11, 2003 at 04:24:48PM +0200, Marcos wrote:
> the program brake and i see the error from the interprer, i want to
> display a "Couldn't load image" message instead the
>
> "Traceback (most recent call last):
> File "<stdin>", line 1, in ?
> pygame.error: Couldn't open...."
>
> error from python.
what you want is exception handling (try: except: blocks),
see http://www.python.org/doc/
paul