1inRecordingMode = False
2for line in file:
3 if not inRecordingMode:
4 if line.startswith('<START>'):
5 inRecordingMode = True
6 elif line.startswith('<END>'):
7 inRecordingMode = False
8 else:
9 yield line
10