Hello, Isn't this similar to php interpolation? And quite readable imo.
>>> import string >>> template = string.Template("$scheme://$host:$port/$route#$fragment") >>> template.substitute(scheme="http", host="google.com", port="80", route="", >>> fragment="") 'http://google.com:80/#' >>> Roy Smith wrote: > There's something nice about building up strings in-line, as > opposed to having to look somewhere to see what's being interpolated. > To give a more complex example, consider: > > print "$scheme://$host:$port/$route#$fragment" > > That certainly seems easier to me to read than: > > print "%s://%s:%s/%s#%s" % (scheme, > port, > host, > route, > fragment) -- http://mail.python.org/mailman/listinfo/python-list