-
-
Save NotTheEconomist/baf7b2d0855bc4658923 to your computer and use it in GitHub Desktop.
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
q = list() | |
last_q = list() | |
with open('newfile.txt') as f: | |
for line in f: | |
q.append(line.strip()) | |
if len(q) == 3: | |
last_q.append(q) | |
q = [] | |
with open('newfile.txt', 'w') as f: | |
for lines in zip(*last_q): | |
print lines | |
f.write("\t".join(lines)+"\n") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment