眼底血管图片数据的采样函数(每隔20行进行采样操作)
with open('DATA.txt') as reader, open('newfile.txt', 'w') as writer: for index, line in enumerate(reader): if index % 20 == 0: writer.write(line)
with open('DATA.txt') as reader, open('newfile.txt', 'w') as writer: for index, line in enumerate(reader): if index % 20 == 0: writer.write(line)