traceback.print_exception(etype, value, tb, limit=None, file=None, chain=True)
Print exception information and stack trace entries from traceback object tb to file. This differs from print_tb() in the following ways:
if tb is not None, it prints a header Traceback (most recent
call last):
it prints the exception etype and value after the stack trace if etype is SyntaxError and value has the appropriate format, it prints the line where the syntax error occurred with a caret indicating the ap