Skip to content

Instantly share code, notes, and snippets.

@georgerichardson
Last active July 25, 2017 21:28
Show Gist options
  • Save georgerichardson/e07419248cb30f378a6ac89109cff266 to your computer and use it in GitHub Desktop.
Save georgerichardson/e07419248cb30f378a6ac89109cff266 to your computer and use it in GitHub Desktop.
Read a newline separated txt file into a list
with open('file.txt', 'r') as f:
text = f.read()
lines_list = text.split('\n')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment