|
|
|
|
|
by 7thaccount
544 days ago
|
|
There were several Python versions shown at the link and the latter one that I was referring to does not read it all into memory. It loops through each line in only three lines of code, not like 1/4 of a page. I tried just pasting the code into the window, but never learned how to format HN on mobile. Sorry for the confusion. After the colon there are indents, so 3 separate lines. with open('testfile.txt') as f:
for line in f:
print(line.strip()) |
|
(I also always forget how to format comments, the ref is here: https://news.ycombinator.com/formatdoc )