py_global_except_hook.py

import sys def my_except_hook(exctype, value, traceback): if exctype == KeyboardInterrupt: print("Handler code goes here") else: print('Error Send...') sys.__excepthook__(exctype, value, traceback) sys.excepthook = my_except_hook
python global exception hook

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.