def parsefile(filename):
    with open(filename) as myfile:
        for line in myfile:
            line = line.rstrip('\n')
fields = struct.unpack('11s11s8s8s5s', line)
if 'OW' in fields[1]:
    yield int(fields[3]), int(fields[4])
Импорт данных из текстового файла с помощью python