Dynamic construction of a print format string

Bruce Edge bedge at troikanetworks.com
Wed Mar 14 13:20:19 EST 2001


I'm using:

  fmtstr = "%s%s%s" % ( "    %", namelen, "s - %s" )

to get:

  "    %19s - %s" 

Is there a better way?

TIA, Bruce.



More information about the Python-list mailing list