[Tutor] formatting sql output

Ivan Van Laningham ivanlan@callware.com
Tue, 04 May 1999 09:28:59 -0600


Hi All--

Deirdre Saoirse wrote:
> 
> 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) ?
>

None whatsoever.  Use what is convenient or what pleases you, as long as
it does the job.

Ivan
----------------------------------------------
Ivan Van Laningham
Callware Technologies, Inc.
ivanlan@callware.com
http://www.pauahtun.org
See also: 
http://www.foretec.com/python/workshops/1998-11/proceedings.html
Army Signal Corps:  Cu Chi, Class of '70
----------------------------------------------