I need to read a large file, line by line. Lets say that file has more than 5GB and I need to read each line, but obviously I do not want to use readlines() bec
readlines()
An old school approach:
fh = open(file_name, 'rt') line = fh.readline() while line: # do stuff with line line = fh.readline() fh.close()