[Tutor] Printing a formatted list (of lists)

lumbricus@gmx.net lumbricus@gmx.net
Mon, 29 Jul 2002 12:39:19 +0200 (MEST)


> Python 2.n on unix.
> 
> I have a table that's a list of lists (values can be mixed
> numbers/text).  Is there a clean way to print a formatted list?  What I
> have works, but it seems that there ought to be a more list-oriented
> way of formatting the list part.  Or is this one of those places where
> one accepts the explicit loop?  I've tried out list comprehension
> variations 'til I'm dizzy with nothing but assorted errors.
> 
> for j in range(len(table)):
>     print `table[j]`.rjust(columnwidth),

split and join?
(string methods)

> Thanks!

HTH, HAND
J"o!

-- 


-- 
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net