Dup Goto 📝

TableGenerator001

PT2/aw/lang/markdown 07-31 13:46:41
To Pop
13 lines, 41 words, 281 chars Monday 2023-07-31 13:46:41

Example 1

k = open("input.txt").read().rstrip()
import re
a = k.splitlines()
b = [re.split(r"(?:\t|\s\s+)",x) for x in a]
h = b[0]
d = b[1:]
print("|"," | ".join(h),"|")
print("|"," | ".join(map(lambda t: "-"*len(t),h)))
for l in d:
  print("|"," | ".join(l),"|")