Oct-12-2017, 04:39 PM
How about: (using Python 3)
from itertools import islice with open(file_name) as fd: alternatelines = islice(fd, 0, None, 2) for line in alternatelines: print(len(line.rstrip()))Same principle as above, but uses islice from itertools to step through the file by 2 lines at a time. (I used rstrip on assumption that each line has a newline character at the end.)
I am trying to help you, really, even if it doesn't always seem that way