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 43 of file table_printer.py.
44 """Prints out a table of data, padded for alignment
46 @param out: Output stream ("file-like object")
47 @param table: The table to print. A list of lists. Each row must have the same
54 for i
in range(len(table[0])):
57 for i, row
in enumerate(table):
59 print(
"-" * (
sum(col_paddings) + (len(col_paddings)*3-1)), end=
'', file=out)
61 print(row[0].ljust(col_paddings[0] + 2), end=
'', file=out)
63 for i
in range(1, len(row)):
64 col =
format_num(row[i]).rjust(col_paddings[i] + 2)
65 print(col, end=
'', file=out)