Query about doing fortran-esque repeat formatting

Rob Briggs rdbriggs at mun.ca
Sun Nov 8 09:56:18 EST 2009


Hello, 

Is there a way to do a repeat formatting command like in Fortran? Rather
that doing this:

print "%s %-5.3f %-5.3f %-5.3f %-5.3f %-5.3f %-5.3f %-5.3f" %
(parmName[i], tmp[i][1], tmp[i][2], tmp[i][4],  tmp[i][6],  tmp[i][7],
tmp[i][8],  tmp[i][9])

Something like this:

print "%s 7%-5.3f % (parmName[i], tmp[i][1], tmp[i][2], tmp[i][4],
tmp[i][6],  tmp[i][7], tmp[i][8],  tmp[i][9])

regards, 

Rob




More information about the Python-list mailing list