Last active
December 16, 2019 09:11
-
-
Save AnthonyDiGirolamo/9665403 to your computer and use it in GitHub Desktop.
How to read a file in python line by line. This method incrementally loads the file.
This file contains 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
#!/usr/bin/env python | |
#import pprint | |
#pp = pprint.PrettyPrinter(indent=4, width=110).pprint | |
with open('all_messages.log') as f: | |
for i, line in enumerate(f): | |
print("{0}:".format(i), end='') | |
print(line) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment