Perl to Python: Exceptions (|| die)

try:
        foobar
except ValueError:
        print “That was not a number“
except:
        print “Something went wrong“
else:
        print “All went well“

Raise an exception: raise NameError, 'This went wrong'

WorkaroundOrg: PerlToPython/Exceptions (last edited 2005-08-29 18:39:45 by ChristophHaas)