Skip to content

Instantly share code, notes, and snippets.

@scj7t4
Created August 29, 2013 15:13
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 scj7t4/6379370 to your computer and use it in GitHub Desktop.
Save scj7t4/6379370 to your computer and use it in GitHub Desktop.
f = open(file)
contents = f.readlines()
while len(contents):
line = contents.pop(0)
#Then if you need to read another line:
#but you'd need to test to make sure the next line is there?
if len(contents) > 0:
line = contents.pop(0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment