This is some interesting code, thanks for posting it here. Good work Mawg. **Nitpicking** > # +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ > # Given the lines and current line number, this function reads > # from the current line (or the first following line containing the start string, Please get rid of banners like this. If you are using an IDE such as PyCharm it can generate documentation comments for you. Current python industry standard regarding documentation is PEP-287. 1. [PEP-287][1] 2. [Related SO Question][2] > lines,lineNumber, Use consistent spacing. I personally like to use [black][3] to format my code. But you can use anything that formats to PEP8. > GetLinesBetween, lineNumber, ... Please use correct PEP8 style such as `get_lines_between` and `line_number`? > #----------------------- > except Exception as err: > print('Exception:') > exc_type, exc_value, exc_tb = sys.exc_info() This is sloppy exception handling. - If you must use a catch-all: Maybe use a higher level method that captures exceptions and change this to `try_get_lines_between` or `_get_lines_between` as a more readable alternative. **Why**: separation of error handling and application logic - It is up to you to decide if this is best course of action. - You can also create your own exceptions if that is more suitable to you. You can for example raise them instead of returning empty list if it is more suitable. - Use a [logger][4] instead of print to log exceptions. `logger.exception` is more suitable for this. - Instead of `sys.exit(0)` - maybe exit with non zero value so you know that there was an error. > emmpty, serach Please use a spell checker plugin in your IDE. **How would I design this better?** - Use generators instead of creating lists, so you can create pipeline of functions and can even read multiple files, and also save some memory. - Maybe use [Aho-Corasick][5] algorithm (Trie based) to match against multiple strings. [1]: https://www.python.org/dev/peps/pep-0287/ [2]: https://stackoverflow.com/questions/3898572/what-is-the-standard-python-docstring-format [3]: https://github.com/ambv/black [4]: https://docs.python.org/3/library/logging.html [5]: https://en.wikipedia.org/wiki/Aho%E2%80%93Corasick_algorithm