execution error

Skip Montanaro skip at pobox.com
Mon May 23 13:38:47 EDT 2005


    Ximo> And my question is how can show the execution error whitout exit
    Ximo> of the program, showing it in the error output as

You need to catch ZeroDivisionError.  Here's a trivial example:

    >>> try:
    ...   6/0
    ... except ZeroDivisionError:
    ...   print "whoops! divide by zero..."
    ... 
    whoops! divide by zero...

Skip



More information about the Python-list mailing list