StringInterpolation
-- NoelWelsh - 28 Apr 2004
I was going to base this topic on the Python Cookbook topic, which was a bit different in approach - given a string with embedded expressions, interpolate the evaluated expressions into the string.
>>> number = 20
>>> text = "python"
>>> print "%(text.capitalize())s %(number/9.0).1f rules!" % Eval()
Python 2.2 rules!
So essentially, it's a simple templating system. The problem with using read=/=eval in this case is that you need some sort of escaping system. I'm thinking that you could do this with fprintf and override the port-print-handler, like this: