Question: 1 . Create a Python program file called Ch 1 0 - 2 _ Name.py . ( Replace Name with your initial of first name
Create a Python program file called ChName.pyReplace Name with your initial of first name and first letters of last name. If your last name is shorter than letters, just use full last name, it doesn't have to be letters. ie if your name is John Doe, your file name should be ChJDoe.py
Your program will take a file name from user and parse the file. Read and parse the lines that begins with "From" and pull out the email addresses from the line. Count the number of messages from each person using a dictionary.
After all the data has been processed, print the person with the most commits by creating a list of count email tuples from the dictionary. Then sort the list in reverse order and print out top users with email usage. Your output should list each email address and frequency.
If user enters wrong information wrong name of the file or nonexisting file name your program needs to display message and ask for correct input. Your program should not generate traceback message with any input.
Do not read the entire file to process. Use only file handle to process it
Sample output
Enter file name to process:fksaldj;f
File fksaldj;f doesn't exist.
Please enter correct file name
Enter file name to process:mboxshort.txt
Here is a list of top email users:
cwen@iupui.edu
zqian@umich.edu
david.horwitz@uct.acza
louis@media.berkeley.edu
gsilver@umich.edu
Do you want to continue? yn n
Thank you for playing.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
