import sys def exc_thrower(x) : z = 0 try : z = 100 / x except : print "Error encountered in exc_thrower: "+repr(sys.exc_type) exc_thrower(0)