Structured writing to console, such as a table

Raaijmakers, Vincent (IndSys, GE Interlogix) Vincent.Raaijmakers at ge.com
Mon Sep 1 15:37:21 EDT 2003


Ok, perhaps a question on a newbie level.

I try to create a simple 'write to a console application' where all the items in a string
do have a variable size:
items = ["a", "bbbbbbbbb", "cc"]
Well, actually, I need to print a table as simple text, nice lined up in a console.
So:


Item:       Value:     Another Value:
----------+----------+------------------
a         | 1        | 2
bbbbbbbbb | 2        | 17
cc        | 3        | 5

My hope was that somewhere in python land an existing module was waiting for me.
A module that also prints lines, headers....

Unfortunately, I can't find it. Books, Google...
Before I reinvent this wheel... please give me some tips, references, examples...


Thanks,
Vincent





More information about the Python-list mailing list