The Python Oracle

How do I print an exception in Python?

Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn

--

Music by Eric Matyas
https://www.soundimage.org
Track title: Over a Mysterious Island Looping

--

Chapters
00:00 Question
00:20 Accepted answer (Score 1744)
00:39 Answer 2 (Score 712)
01:05 Answer 3 (Score 196)
01:23 Answer 4 (Score 95)
03:23 Thank you

--

Full question
https://stackoverflow.com/questions/1483...

Answer 1 links:
[traceback]: http://docs.python.org/library/traceback...
[formatting and printing exceptions]: https://docs.python.org/3/library/traceb...

Answer 3 links:
[logging]: https://docs.python.org/3/library/loggin...
[documentation]: https://docs.python.org/3/howto/logging....
[logging.exception()]: https://docs.python.org/3/library/loggin...
[log level]: https://docs.python.org/3/library/loggin...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #exception #errorhandling

#avk47