Last active
July 25, 2017 21:28
-
-
Save georgerichardson/e07419248cb30f378a6ac89109cff266 to your computer and use it in GitHub Desktop.
Read a newline separated txt file into a list
This file contains hidden or 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
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