Ievgeniia Zadorozhna | 8402302 | 2021-12-30 13:00:41 +0200 | [diff] [blame^] | 1 | import texttable as tt |
| 2 | |
| 3 | |
| 4 | class helpers(object): |
| 5 | |
| 6 | def __init__(self): |
| 7 | pass |
| 8 | |
| 9 | def draw_table_with_results(self, global_results): |
| 10 | tab = tt.Texttable() |
| 11 | header = [ |
| 12 | 'node name 1', |
| 13 | 'node name 2', |
| 14 | 'network', |
| 15 | 'bandwidth >', |
| 16 | 'bandwidth <', |
| 17 | ] |
| 18 | tab.set_cols_align(['l', 'l', 'l', 'l', 'l']) |
| 19 | tab.set_cols_width([27, 27, 15, 20, '20']) |
| 20 | tab.header(header) |
| 21 | for row in global_results: |
| 22 | tab.add_row(row) |
| 23 | s = tab.draw() |
| 24 | print(s) |