Prints out a table of data, padded for alignment
@param out: Output stream ("file-like object")
@param table: The table to print. A list of lists. Each row must have the same
number of columns.
Definition at line 46 of file table_printer.py.
47 """Prints out a table of data, padded for alignment
49 @param out: Output stream ("file-like object")
50 @param table: The table to print. A list of lists. Each row must have the same
57 for i
in range(len(table[0])):
60 for i, row
in enumerate(table):
62 print_(
"-" * (
sum(col_paddings) + (len(col_paddings)*3-1)), end=
'', file=out)
64 print_(row[0].ljust(col_paddings[0] + 2), end=
'', file=out)
66 for i
in range(1, len(row)):
67 col =
format_num(row[i]).rjust(col_paddings[i] + 2)
68 print_(col, end=
'', file=out)