Skip to content

Instantly share code, notes, and snippets.

@5tigerjelly
Created April 11, 2018 20:26
Show Gist options
  • Save 5tigerjelly/1c5be8c8fd09ba2699ff13ac657331b4 to your computer and use it in GitHub Desktop.
Save 5tigerjelly/1c5be8c8fd09ba2699ff13ac657331b4 to your computer and use it in GitHub Desktop.
def parseText(large_text, parse_term):
result_list = []
# if not found
if not large_text:
return result_list
found = False
for line in large_text.strip().splitlines():
line = line.strip().lower()
if found:
if line != '' and line != '.':
result_list.append(line)
continue
else:
found = False
continue
if line == parse_term.lower():
found = True
continue
return result_list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment