Python: How to print the full traceback without exiting the program?
The exception handling block
except Exception as ex: print(ex) will only print the exception message and not its traceback.
That’s good to know, but we need more info than this to debug properly. Namely the line that raised the exception, together with its stack trace.
traceback module, part of the stdlib, will help us with this: