Skip to content

Instantly share code, notes, and snippets.

@justinfx
Created April 17, 2013 22:00
Show Gist options
  • Save justinfx/5408129 to your computer and use it in GitHub Desktop.
Save justinfx/5408129 to your computer and use it in GitHub Desktop.
python snippet for dumping a call stack at any point in code
import inspect
def trace():
frames = (str(f[1:4]) for f in inspect.getouterframes(inspect.currentframe())[1:])
print "\n".join(frames)
print '\n'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment