n_process = 100
n_overlap = 10
data_chunk = []
for line in fin.readline():
    vals = line.split()
data_chunk.append(vals)
if len(data_chunk) == n_process:
    process(data_chunk)
data_chunk = data_chunk[-n_overlap:]
Process large file in chunks