Last active
August 29, 2015 14:04
-
-
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
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
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