queries about exceptions(newbie)

Payal payal-python at scriptkitchen.com
Fri Jun 4 05:52:50 EDT 2010


On Thu, Jun 03, 2010 at 11:42:16PM -0700, Chris Rebert wrote:
> >>> try:
> ...     x[1]
> ... except IndexError as e:
> ...     print "Got error:", e.args[0] # grab the error message
> ...
> Got error: list index out of range

Thanks a lot. This example solved what the tutorial could not.

With warm regards,
-Payal
-- 




More information about the Python-list mailing list