Question: Exercise 3.2 (design, simplediff.py) Before attempting to code this problem, create a file design that contains some analysis of how you think the problem will

 Exercise 3.2 (design, simplediff.py) Before attempting to code this problem, create

Exercise 3.2 (design, simplediff.py) Before attempting to code this problem, create a file design that contains some analysis of how you think the problem will be solved. Examples include but are not limited to: a flowchart of events in the program, pseudocode, or a step-by-step process written in plain English. If you choose to scan your design, please make sure that it is legible. Write a "diff" program that prints out the differences, line by line, of two files. Your program should ask the user for the names of two files, then print the differences between them. Follow the format output as shown below. Make sure to use proper error handling techniques for file I/O Assume all files have the same number of lines. The following output shows the output of the files file1.txt and file2.txt. 1 $ cat filel.txt 2 John goes to work Keith and Kyle vent to the Ensiferum concert Alice ate an apple pie s Joe cut down a tree The dog jumped over the vall 7 $ cat file2.txt s John goes to work 9 Coral went to a Kesha concert o Alice ate an apple pie n Joe planted a tree 12 The dog jumped over the wall This is the result of running the script simplediff.py on the two files: python simplediff.py 2 Enter file name 1 >>> file1.txt Enter file name 2 >>> file2.txt s 2c0 6 Coral went to a Kesha concert 9 4c4 o Joe cut down a tree 12 Joe planted a tree The 2c0 tag refers to where the difference occurred and can be read as line 2 character 0 (where lines are 1 indexed and characters are zero indexed). Compare the output of your script to that of the diff program by typing diff file1.txt file2.txt in your shell

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!