Jul-09-2020, 09:25 AM
this is not tested, but should work:
nxline = False with open('file.txt') as fp: for line in fp: line = line.strip() if nxline: print(f"Got a number: {line}") nxline = False else: if 'Line' in line: nxline = True