Skip to content

Instantly share code, notes, and snippets.

View enricodvn's full-sized avatar

Enrico enricodvn

  • Spocket
View GitHub Profile
@enricodvn
enricodvn / text_side_by_side
Last active September 17, 2021 14:39
Text side by side in form of columns. Column width is given as the widest one.
from itertools import zip_longest
def text_side_by_side(*texts, separator="\t"):
max_length = 0
texts_lines = []
for text in texts:
# finds the widest one
text_lines = text.splitlines()
texts_lines.append(text_lines)
for line in text_lines: