Skip to content

Instantly share code, notes, and snippets.

@fnielsen
Created July 11, 2011 13:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fnielsen/1075844 to your computer and use it in GitHub Desktop.
Save fnielsen/1075844 to your computer and use it in GitHub Desktop.
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