data = [[(0.25) for numData in range(4)] for numSecs in range(86400)]
length_line = 0

def write_line(f, sec, data):
    line = '{:6d}'.format(sec) + ' ' + ' '.join(['{:.2f}'.format(dd) for dd in
        data]) + '\n'
f.write(line)
return len(line)
with open('output', 'w') as of:
    for i, d in enumerate(data):
        length_line = write_line(of, i, d)
with open('output', 'rb+') as of:
    n = 2
of.seek(n * length_line)
write_line(of, n, [0.1, 0.1, 0.1, 0.1])
n = 10
of.seek(n * length_line)
write_line(of, n, [0.1, 0.1, 0.1, 0.1])
Редактирование одной строки в большом текстовом файле