While writing a module in Python 2.7 I had the need of a way for doing
name = "Rodrigo"
age = 34
print f"Hello {name}, your age is {age}".format()
although I know I could just do:
print "Hello {name}, your age is {age}".format(name=name, age=age)
format() would look in the scope for variables name and age, cast them to a string (if possible) and paste into the message. I've found that this is already implemented in Python 3.6+, called Formatted String Literals. So, I was wondering (couldn't find it googling) if anyone has made an approach to something similar for Python 2.7
.format(dict(globals(), **locals()))- Jon Clements♦