Skip to content

Instantly share code, notes, and snippets.

@NotTheEconomist
Created February 5, 2015 22:50
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 NotTheEconomist/baf7b2d0855bc4658923 to your computer and use it in GitHub Desktop.
Save NotTheEconomist/baf7b2d0855bc4658923 to your computer and use it in GitHub Desktop.
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