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