Question: 1 . Create a folder named files then download and store input.txt in it . 2 . Write program that will: a . Ask the

1. Create a folder named files then download and store input.txt in it.
2. Write program that will:
a. Ask the user for the input file name (use exceptions to deal with a missing file).
b. Once the right file name is provided, create an output file named output.csv.
i. This file should also be stored in the files folder.
ii. Please note, before you store output.csv in the files folder, you need to check if there already exists a file with that name in the folder. Use the os.path module (not exception handling) to check if the file already exists. If it does, ask the user if they want to overwrite it or if they would prefer creating a different output file (refer to sample output for the logic). Regarding the os module, the code below is enough to get you started.
iii. If no file exists with the name output.csv, a new file with that name should be created. If the file already exists, ask the user if they want to overwrite it. If they select y for yes, you can use the w file mode to overwrite the file. If they select n for no, ask them for a new output file name.
c. Once the output.csv file is successfully created, create a header row in it with the headers: Email, Time, and Confidence.
d. Go through the lines in input.txt looking for lines that begin with (please note the colons are part of the text)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!