Skip to content

Instantly share code, notes, and snippets.

@tmacam
Created May 29, 2013 13:40
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 tmacam/5670327 to your computer and use it in GitHub Desktop.
Save tmacam/5670327 to your computer and use it in GitHub Desktop.
Handy python function to print the current executing python line number , function name and filename.
from inspect import getframeinfo, getouterframes, currentframe
def HERE():
info = getframeinfo(getouterframes(currentframe())[1][0])
print "\t__HERE: @%s %s:%d" % (info.function, info.filename, info.lineno)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment