python try catch and continue code example
Example 1: python try except continue loop
try:
#code
except:
#pass to continue loop or error handling
pass
else:
#code
pass
finally:
pass
Example 2: python defualt error handler
import sys
def my_except_hook(exctype, value, traceback):
if exctype == KeyboardInterrupt:
print "Handler code goes here"
else:
sys.__excepthook__(exctype, value, traceback)
sys.excepthook = my_except_hook