Skip to content

Instantly share code, notes, and snippets.

@nedbat
Created October 14, 2015 19:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nedbat/2a73a9d1d12ce13e59da to your computer and use it in GitHub Desktop.
Save nedbat/2a73a9d1d12ce13e59da to your computer and use it in GitHub Desktop.
with open("/tmp/foo.txt", "a") as f:
print >>f, "-----", __name__
import inspect;print >>f, ("\n".join("%30s : %s @%d" % (t[3], t[1], t[2]) for t in inspect.stack()[:0:-1]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment