Dynamic construction of a print format string
Warren Postma
embed at geocities.com
Wed Mar 14 13:37:21 EST 2001
"Bruce Edge" quoth:
> fmtstr = "%s%s%s" % ( " %", namelen, "s - %s" )
> to get:
> " %19s - %s"
fmtstr = " %"+`namelen`+" - %s"
More information about the Python-list
mailing list