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

[pygame] Detect errors in fuctions



Hi, 

Exist anyway to detect when a pygame function makes an error? 

For exmple in the C version of SDL_image when you try to load a image
and the fuction can't (the image don't exists, the file isn't an
image...) it returns a pointer to null, then you can manage this error.

Is similar with python & pygame? 
Now if a do: "pygame.image.load("./imagethatnotexist")"

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.


Thanks.

P.D. Sorry for my english.


---Publicidad--------------------------------------------------------
Juega con Ventura24.es, loterķa inteligente y multiplica tus
posibilidades!! http://www.iespana.es/_reloc/email.ventura