[Tutor] formatting sql output

Deirdre Saoirse deirdre@deirdre.net
Mon, 3 May 1999 19:37:35 -0400 (EDT)


On Mon, 3 May 1999, Ivan Van Laningham wrote:

> > def fieldformat15(field):
> >         return '%-15s' % field
> 
> The format specification is incorrect.  You should use "%15.15s" or
> "%-15.15s" to force left justification, in addition to padding/clipping.

Is there a reason not to use return string.ljust(field, 15) ?

_Deirdre   *   http://www.linuxcabal.org   *   http://www.deirdre.net
"Solving today's problems tomorrow, with yesterday's technology."