Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Python Expert

1. Programming problem.

Without using the system() function to call any bash commands, prepare a python program that will implement a simple version of the diff command. This command will look at the contents of two directories and report on the differences between them. This includes those files that are only in one directory or the other, as well as files that have the same name, but have different characteristics as defined below. The format of this command will be: diff [-R] [-c value] directory1 directory2

The options are as follows:

• -c value, determines what level of difference should be reported between two files. If not specified, the default is to say that two files are the same if they have the same name and are not different types (file vs. directory). If the option is specified with a value of 1, then two files are only considered the same if they also have the same size. If the option is specified with a value of 2, then two files are only considered the same if they have the same size and the same exact contents.

• -R, when present the contents of subdirectories with common names in each directory should also be analysed in a recursive manner.
The report generated by the program should include three lists of files for every pair of directories (or subdirectories in the recursive case). The first list contains those files only in directory1. The second list contains those files only in directory2. The third list contains those files that have the same name in each directory, but are considered different based on the -c option value. These lists should be sorted alphabetically.

If a bad option is given to the command an error message should be displayed (including a bad value to the -c option). If anything other than two directories are specified on the command line, an error message should be displayed.

Python, Programming

  • Category:- Python
  • Reference No.:- M9905

Have any Question? 


Related Questions in Python

Questionwhat is a python development frameworkgive 3

Question What is a python development framework? Give 3 examples python development framework used today. and explain which development framework is used in which industry.

Simple python traffic lightswrite a program that simulates

Simple Python (Traffic lights) Write a program that simulates a traffic light. The program lets the user select one of three lights: red, yellow, or green. When a radio button is selected, the light is turned on, and onl ...

Show times in tmus and seconds1 an associate grasps an oven

Show times in TMUs and seconds. 1. An associate grasps an oven door within reach and pulls it open 18 inches with the left hand (he does not relinquish control of the door). With a pan in the right hand, he carefully pos ...

Python programming assignment -you first need an abstract

Python Programming Assignment - You first need an abstract base class, called, Account which has the following attributes and methods: accountID: This attribute holds the ID assigned the account , if not provided set to ...

A software company sells a package that retails for 99

A software company sells a package that retails for $99. Quantity discounts are given according to the following table: Quantity Discount 10 - 19 20% 20 - 49 30% 50 - 99 40% 100 or more 50% Write a program using python t ...

Question a software company sells a package that retails

Question : A software company sells a package that retails for $99. Quantity discounts are given according to the following table: Quantity Discount 10 - 19 20% 20 - 49 30% 50 - 99 40% 100 or more 50% Write a program usi ...

Tasksdemonstrate data scraping of a social network of

Tasks Demonstrate data scraping of a social network of choice. Develop technical documentation, including the development of the code & detailing the results. Provide a report on the findings, that includes research into ...

The second task in this assignment is to create a python

The second task in this assignment is to create a Python program called pancakes.py that will determine the final order of a stack of pancakes after a series of flips.(PYTHON 3) Problem Task In this problem, your input w ...

Quesiton write a python script that counts occurrences of

Quesiton: Write a python script that counts occurrences of words in a file. • The script expects two command-line arguments: the name of an input file and a threshold (an integer). Here is an example of how to run the sc ...

Project reconnaissance and attack on ics

Project: Reconnaissance and Attack on ICS NetworksEnvironment Setup The second mini project will be based on Industrial Network Protocols, specifically the Modbus protocol. Please follow the instructions carefully to set ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As