Raise error from function : Raise : Statement PYTHON TUTORIALS


PYTHON TUTORIALS » Statement » Raise »

 

Raise error from function


import sys

def excFunc() :
    raise ValueError

try:
    excFunc()
except:
    print "Got an exception"
    print sys.exc_info()



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Statement
» Raise