Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
pløf
#!/usr/bin/env python3
import sys
texts = [ open(filename).read().split() for filename in sys.argv[1:]]
maxlength = [ max(map(len, t)) for t in texts ]
for line in zip(*texts):
print("".join([ line[n] + " " * (maxlength[n] - len(line[n]) + 1) for n in range(len(line)) ]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment