In this task you will write a python script that will prompt a user for a...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
In this task you will write a python script that will prompt a user for a directory to archive, ask them if they want the archive compressed, and (only if they do want compression) what type of compression to apply. THE TASK: follow step by step please! 1. In your bin directory, create the file tarchiver.py, and populate with our standard beginning: # !/usr/bin/env python3 # tarchiver.py # Purpose: Creates a tar archive of a directory # # USAGE: ./tarchiver.py # import os #continue scripting here... 2. Next, add prompts using the input function to ask the user for: • The directory they wish to archive. • The name they want to give the archive. Remember to store their responses in variables. 3. Add a line that uses the values provided by the user to execute a tar command and cr3ate and archive of the directory they requested. 4. Test your script to make sure it works. 5. Add a third prompt (immediately after the other two prompts and before the tar command), asking the user if they want the archive to be compressed. You'll need an if statement to run your tar command with gzip compression if they answered yes. 6. Test your script to make sure it works. 7. Add a fourth prompt asking the user what type of compression they want (present them with gzip, bzip2, and xzip as options). Note that this prompt should only be shown if the user opted for compression (if they don't want compression, there is no point asking what type they don't want). 8. Expand the if statement around your actual tar command to use whichever type of compression the user asked for. 9. Test your script to make sure it works. 10. Test your script again, but feed it nonsense data (e.g. answer 'very much so' instead of 'y' or 'n' when prompted about compression). 11. Add loops around your prompts for whether or not the user wants compression, and the compression type to make the script repeat each prompt until the user gives a response your script can actually use. Don't worry about doing anything with the archive name or path. 12. Now test your script again, with good data and with nonsense. 13. When you are confident your script works, please put it and submit it here. Thanks tutor In this task you will write a python script that will prompt a user for a directory to archive, ask them if they want the archive compressed, and (only if they do want compression) what type of compression to apply. THE TASK: follow step by step please! 1. In your bin directory, create the file tarchiver.py, and populate with our standard beginning: # !/usr/bin/env python3 # tarchiver.py # Purpose: Creates a tar archive of a directory # # USAGE: ./tarchiver.py # import os #continue scripting here... 2. Next, add prompts using the input function to ask the user for: • The directory they wish to archive. • The name they want to give the archive. Remember to store their responses in variables. 3. Add a line that uses the values provided by the user to execute a tar command and cr3ate and archive of the directory they requested. 4. Test your script to make sure it works. 5. Add a third prompt (immediately after the other two prompts and before the tar command), asking the user if they want the archive to be compressed. You'll need an if statement to run your tar command with gzip compression if they answered yes. 6. Test your script to make sure it works. 7. Add a fourth prompt asking the user what type of compression they want (present them with gzip, bzip2, and xzip as options). Note that this prompt should only be shown if the user opted for compression (if they don't want compression, there is no point asking what type they don't want). 8. Expand the if statement around your actual tar command to use whichever type of compression the user asked for. 9. Test your script to make sure it works. 10. Test your script again, but feed it nonsense data (e.g. answer 'very much so' instead of 'y' or 'n' when prompted about compression). 11. Add loops around your prompts for whether or not the user wants compression, and the compression type to make the script repeat each prompt until the user gives a response your script can actually use. Don't worry about doing anything with the archive name or path. 12. Now test your script again, with good data and with nonsense. 13. When you are confident your script works, please put it and submit it here. Thanks tutor
Expert Answer:
Answer rating: 100% (QA)
Step 1 Create the tarchiverpy script with the initial code structure usrbinenv python3 tarchiverpy Purpose Creates a tar archive of a directory USAGE tarchiverpy import os Continue scripting here This ... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
A company has three production centres, A, B and C and two service cost centres, X and Y. Costs allocated to service centres are required to be apportioned to the production centres to find our cost...
-
1. Implement the Stack family instance method flip declared as follows (this is a Stack ): * Reverses ("flips") (@code this). * * @updates this @ensures this = rev (#this) public void flip(); 2....
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Question #1 The following table indicates the net cash flows of a capital asset: Year Net Cash Flow 0 $-8,400 1 $5,900 2 $6,200 Do not enter dollar signs or commas in the input boxes. Use the...
-
Shell's commitment to the success of its foreign assignments is demonstrated by its efforts to uncover expatriate concerns. Discuss the results of Shell's survey to its present and past expatriates...
-
Calculate the molar mass of a gas if equal volumes of oxygen and the unknown gas take 5.2 and 8.3 minutes, respectively, to effuse into a vacuum through a small hole under the same conditions of...
-
Convert the following into standard form: 1. \(1.02 \times 10^{6}\) 2. \(4.09 \times 10^{-5}\)
-
Measures of Internal Business Process Performance DataSpan, Inc., automated its plant at the start of the current year and installed a flexible manufacturing system. The company is also evaluating...
-
context: The Central Bank of Romania is about to engage in indirect intervention. It is expected that Romania's interest rates will be lowered substantially. Lower interest rates will have an impact...
-
Buhler Industries is a farm implement manufacturer. Management is currently evaluating a proposal to build a plant that will manufacture lightweight tractors. Buhler plans to use a cost of capital of...
-
With reference to Leadership grid, where would you place the following industries on the basis of concern for people and concern for result and why? a) Telecommunication b) Information and Technology...
-
Why do organizations find internal audits useful? In what ways does internal auditing have a competitive advantage over external auditing?
-
Explain how knowledge of internal controls allows internal auditors to perform useful operational audits of an organizations technical areas, even when the auditor does not have the technical...
-
What is the purpose of the general and technical standards of the AICPA Code of Professional Conduct?
-
A typical objective of an operational audit is to determine whether an entitys a. Internal controls are operating as designed. b. Operational information is in accordance with governmental auditing...
-
a. What is the general nature of the questions included in internal control questionnaires? b. Identify several advantages of using questionnaires to document the auditor's understanding of relevant...
-
P2.6 Black Star Inc.'s stock is currently selling at $20 per share. For each of the following situa- tions (ignoring brokerage commissions), calculate the gain or loss that Priscilla Moyo realizes if...
-
How do network effects help Facebook fend off smaller social-networking rivals? Could an online retailer doing half as much business compete on an equal footing with Amazon in terms of costs? Explain.
-
Worklife balance suggests that life outside the jobfamily or personal lifecan become equalized to the work side, to restore and sustain balance. Do you believe this is possible without diminishing...
-
Have your students go to http://www.blogsouthwest.com/media_image, click on Image Gallery and view two or three of the videos such as Nutty stuff. These videos are produced to share with the public...
-
How has Yee been able to coach and develop others who work with her to embrace her commitment to people as well as to the product she manufacturers?
-
From the following selected balances of State plc as at 31 December 2008, prepare (j) a detailed trading and profit and loss account for the year ended 31 December 2008 for internal use and (ii) a...
-
The following information has been extracted from the books of account of Rufford plc for the year to 31 March 2006: Additional information: : 1. Administrative expenses include the following items:...
-
From the following balances in the books of Breaker plc you are to draw up (i) a detailed trading and profit and loss account for the year ending 31 March 2004 for internal use, and (ii) a profit and...
Study smarter with the SolutionInn App