Python: Print stack-trace

Surprisingly, this doesn't come as a standard function in the Exception class.

import traceback
try:
raise Exception("print exception!")
except:
print traceback.format_exc()

Short and simple, so good!

21e03c8c-ca74-4007-a3af-631871431c2c

Source

 
Copyright © Twig's Tech Tips
Theme by BloggerThemes & TopWPThemes Sponsored by iBlogtoBlog