Answers for "function error python"

14

throwing an exception python

raise Exception("message")
Posted by: Guest on June-22-2020
0

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
Posted by: Guest on August-27-2020

Python Answers by Framework

Browse Popular Code Answers by Language