result = []
current = ''
for block in iter(lambda : fp.read(BLOCKSIZE), ''):
    current += block
while 1:
    markerpos = current.find(marker)
if markerpos == -1:
    break
result.append(current[:markerpos])
current = current[markerpos + len(marker):]
result.append(current)
return result
How to read a big binary file and split its content by some marker