Created
July 25, 2019 01:39
-
-
Save Hanrui-Wang/7dd833bafc8219c40cc47c8137429663 to your computer and use it in GitHub Desktop.
read file line by line
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(path, 'r') as f: | |
| for line in f: | |
| # no need to lines = f.read().split('\n')[:-1] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment