Error managment question (Trace Backs ?)

vpr mvanaswegen at gmail.com
Thu Sep 1 16:32:16 CEST 2005


Hi

This is a noob question, but here goes. I have a class that calls a
function.


class test:
      def __init__(self):
            if foo():
                 print "it worked"
            else:
                 print "error"


def foo():
    some test returns 1 or 0

Now in other langs like C / C++ I catch the error in foo and report and
exit.
However I suspect in python that I can raise it and the class can catch
it ?

Guess I'm new to Traceback's ,etc

Seeking Python Zen :)

Marinus




More information about the Python-list mailing list