Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@kgadek
Last active August 29, 2015 14:04
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 kgadek/c154992d4adc8b40c762 to your computer and use it in GitHub Desktop.
Save kgadek/c154992d4adc8b40c762 to your computer and use it in GitHub Desktop.
Shortcut for print("stuff {key}".format(**locals())). Used a snippet: http://stackoverflow.com/a/6618825/547223
def printl(s):
import inspect
frame = inspect.currentframe()
try:
print s.format(**frame.f_back.f_locals)
finally:
del frame
def foo():
a = 123
printl("yoah {a}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment