Re: Query about doing fortran-esque repeat formatting

2009-11-09 Thread Glenn Hutchings
Rob Briggs rdbriggs at mun.ca writes: 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]) There

Re: Query about doing fortran-esque repeat formatting

2009-11-09 Thread Jean-Michel Pichavant
Glenn Hutchings wrote: Rob Briggs rdbriggs at mun.ca writes: 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],

Re: Query about doing fortran-esque repeat formatting

2009-11-09 Thread Rob Briggs
Thanks to the chaps who answered, I knew there would be an efficient answer to this. regards, Rob On Mon, 2009-11-09 at 13:31 +0100, Jean-Michel Pichavant wrote: Glenn Hutchings wrote: Rob Briggs rdbriggs at mun.ca writes: Is there a way to do a repeat formatting command

Query about doing fortran-esque repeat formatting

2009-11-08 Thread Rob Briggs
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 %

Re: Query about doing fortran-esque repeat formatting

2009-11-08 Thread Mensanator
On Nov 8, 8:56�am, Rob Briggs rdbri...@mun.ca wrote: 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],

Re: Query about doing fortran-esque repeat formatting

2009-11-08 Thread Novocastrian_Nomad
How about: print ('%s ' + '%-5.4f ' * 7) % ('text',1,2,3,4,5,6,7) -- http://mail.python.org/mailman/listinfo/python-list