One of the answers for this question says that the following is a good way to read a large binary file without reading the whole thing into memory first:
with open(image_filename, 'rb') as content:
for line in content:
#do anything you want
I thought the whole point of specifying 'rb'
is that the line endings are ignored, therefore how could for line in content
work?
Is this the most "Pythonic" way to read a large binary file or is there a better way?