![]() |
ATLAS Offline Software
|
Functions | |
| format_num (num) | |
| get_max_width (table, index) | |
| pprint_table_to (out, table, header_loc=1) | |
| pprint_table (table, header_loc=1) | |
| pprint_table_string (table, header_loc=1) | |
Variables | |
| str | __version__ = "0.1" |
| str | __author__ = "Ryan Ginstrom" |
| list | table |
Prints out a table, padded to make it pretty. call pprint_table with an output (e.g. sys.stdout, cStringIO, file) and table as a list of lists. Make sure table is "rectangular" -- each row has the same number of columns. MIT License Taken from: http://ginstrom.com/scribbles/2007/09/04/pretty-printing-a-table-in-python/ Found with the google search "python print table" March 2010 Minor modifications by <peter.waller@cern.ch> to include a "-" seperator for the header, and to change the number format code.
| python.ext.table_printer.format_num | ( | num | ) |
Format a number according to given places. Adds commas, etc.
Definition at line 28 of file table_printer.py.
| python.ext.table_printer.get_max_width | ( | table, | |
| index ) |
Get the maximum width of the given column index
Definition at line 37 of file table_printer.py.
| python.ext.table_printer.pprint_table | ( | table, | |
| header_loc = 1 ) |
Definition at line 68 of file table_printer.py.
| python.ext.table_printer.pprint_table_string | ( | table, | |
| header_loc = 1 ) |
Definition at line 71 of file table_printer.py.
| python.ext.table_printer.pprint_table_to | ( | out, | |
| table, | |||
| header_loc = 1 ) |
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.
|
private |
Definition at line 22 of file table_printer.py.
|
private |
Definition at line 21 of file table_printer.py.
| list python.ext.table_printer.table |
Definition at line 78 of file table_printer.py.