This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tabulate import tabulate | |
def print_tables_side_by_side(*tables, spacing: int = 3): | |
string_tables_split = [tabulate(t, headers="firstrow").splitlines() for t in tables] | |
spacing_str = " " * spacing | |
num_lines = max(map(len, string_tables_split)) | |
paddings = [max(map(len, s_lines)) for s_lines in string_tables_split] |