Skip to content

Instantly share code, notes, and snippets.

@bergantine
Last active October 2, 2015 20:18
Show Gist options
  • Select an option

  • Save bergantine/2312432 to your computer and use it in GitHub Desktop.

Select an option

Save bergantine/2312432 to your computer and use it in GitHub Desktop.
Display exceptions in a Python try / except statement. #python #exception #except #try #sys #traceback
import sys
import traceback
try:
# do something
except:
traceback.print_exc(file=sys.stdout)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment