Created
May 29, 2013 13:40
-
-
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.
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
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