4 ms·
I use the format: foo = 'foo' bar = 'bar' print "%(foo)s%(bar)s" % locals() which I guess is what this is similar too. basically locals(), vars(), and globals(
by jegutman 12y ago
I use the format:
foo = 'foo'
bar = 'bar'
print "%(foo)s%(bar)s" % locals()
which I guess is what this is similar too.
basically locals(), vars(), and globals() I find very useful for string formatting.