python – Read file from and to specific lines of text
If you simply want the block of text between Start and End, you can do something simple like: with open(‘test.txt’) as input_data: # Skips text before the beginning of the interesting block: for line in input_data: if line.strip() == ‘Start’: # Or whatever test is needed break # Reads text until the end of the … Read more