Skip to content

Instantly share code, notes, and snippets.

@thomasyip
Created December 1, 2014 02:57
Show Gist options
  • Save thomasyip/5eec33abfb4fa4b588f6 to your computer and use it in GitHub Desktop.
Save thomasyip/5eec33abfb4fa4b588f6 to your computer and use it in GitHub Desktop.
Python Utilities -- Save a few line of typing
## Print stack trace
def exception_printer(sender, **kwargs):
import sys, traceback
print >> sys.stderr, ''.join(traceback.format_exception(*sys.exc_info()))
raise
## Set breakpoint
import pdb
pdb.set_trace()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment