In our week 3 training we brought all of our basic training together. You learned about:
- Input/Output
- Exceptions & Assertions
This implementation work expects you to bring in all of what you learned into this program.
- Use functions - remember to keep these as small as possible
- Read in a file - for this exercise, use the
Alice In Wonderland Text.txt
in Files - Search for a text phrase (pattern) in the file
- Keep a log file
- Have a new file created for each day - do not overwrite your log file
- Be sure to ALWAYS include the following:
- search phrase used
- number of times found (if any)
- separator for when you have multiple runs
- If not found, notate in log file.
- If found, notate line number in log file.
- Ability for user to turn on or off printing line in log file.
- Ability to print synopsis of run on CLI
For this project you will likely be using:
- str.rstrip()
- module
re
(regular expressions & specifically re.search() ... though there are other options out there - regex tools:
- checking if a file exists