hw13: Midshipman email addresses
- Due before the beginning of class on Friday, February 27
Your task
Write a Python program emails.py which does the following:
- Displays a prompt
filename:and gets the user to type in the name of a file on the command line - Opens that file an searches for the email addresses of all current USNA Midshipmen in the file. (Current means classes 2026-29.)
- Prints out the email addresses (only) of all current USNA Midshipmen in the file.
You will want to use the re module for regular expressions, and the
functions we learned about in class.
Here is the Python re module documentation).
Sample run
If you do a git pull, you should see a new folder for this HW, with
a sample file msg.txt for testing.
Here is how your program should work with that file (blue text is what your program should print, green text is what someone would type in):
roche@ubuntu$python3 emails.pyfilename: msg.txtm283481@usna.edum267855@usna.edum291234@usna.edum290417@usna.edum284427@usna.edum276745@usna.edum263227@usna.edu
Submit command
To submit files for this homework, run one of these commands:
submit -c=sd212 -p=hw13 emails.py
club -csd212 -phw13 emails.py