Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Advanced Python Mastery – A Course by David Beazley. Parent comment
That will read the file as needed (ie as you iterate over it) instead of loading the entire thing in memory.
for record in read_portfolio(fn): # do stuff
That will read the file as needed (ie as you iterate over it) instead of loading the entire thing in memory.