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) > > because I don't have to line up the nth format specifier with the nth > data item.
well, in python3 you can use dict to format strings >>> print("%(a)s" % {'a':'b'}) b and you can achieve php interpolation via locals() >>> a = 'b' >>> print("%(a)s" % locals()) b -- By ZeD -- http://mail.python.org/mailman/listinfo/python-list