Error managment question (Trace Backs ?)

V

vpr

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,266
Messages
2,571,318
Members
47,998
Latest member
GretaCjy4

Latest Threads

Top