from itertools import islice
with open('filename') as f:
    for line in f:
        if line.split()[0] == '256':
            XO = [line.split(None, 4)[3] for line in islice(f, 500)]
Need to read specific range of text file in Python