Skip to content

Instantly share code, notes, and snippets.

@managai
Last active December 14, 2015 03:29
Show Gist options
  • Save managai/5021277 to your computer and use it in GitHub Desktop.
Save managai/5021277 to your computer and use it in GitHub Desktop.
Python: read file line by line into list
import os
with open(fname) as f:
content = f.readlines()
f.close()
# http://stackoverflow.com/questions/3277503/python-read-file-line-by-line-into-array
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment