Created
December 1, 2014 02:57
-
-
Save thomasyip/5eec33abfb4fa4b588f6 to your computer and use it in GitHub Desktop.
Python Utilities -- Save a few line of typing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 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