Created
April 11, 2018 20:26
-
-
Save 5tigerjelly/1c5be8c8fd09ba2699ff13ac657331b4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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