[Tutor] String format question

andy surany mongo57a@comcast.net
Wed Nov 27 13:19:09 2002


Hello list,

I am concatenating a series of string elements for display to a scrolled
list. The code is working fine - but the result is not as user friendly
as I would like. This is what I'm doing:

# The individual contents of a,b, & c can be variable lengths.
#
# Now I use "map" to concatenate the individual records
options=map((lambda i: a[i]+b[i]+c[i]),range(nrecs)
self.ScrolledList(options) # This function populates the list.

This is what the output looks like:

aaa bbb ccc
aaa bb ccccc
a b c

Now what I would like is:

aaa  bbb  ccc
aaa  bb    ccccc
a      b     c

(i.e.: aligned columns)

How can/should I do this?

TIA.

-Andy