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...
-
An 8-kg plunger is released from rest in the position shown and is stopped by two nested springs; the constant of the outer spring is k1 = 3 kN/m and the constant of the inner spring is k2 = 10 kN/m....
-
The Barden Corporations comparative balance sheets for 20X1 and 20X0 are presented below. Income Statement for the Year Ended December 31, 20X1 $ 1,600,000 2,000 44,000 1,646,000 720,000 386,000...
-
It seems that there are many ways for fraud and abuse to take place in the field of accounting. How can this occur when there are so many regulatory bodies and professional accounting standards in...
-
Predecting sales and variable costs using contribution margin Bloom company management predicts that it will incur fixed costs of $160,000 and earn protax income of $164,000 in the next period. Its...
-
Under Working Capital Management and Debt What are some of the advantages and disadvantages of short-term vs long-term debt? What are some actions a firm can take to shorten its cash? Public and...
-
The trial balance of Racer Internet at March 31, 2012, follows: Adjustment data at March, 31, 2012 a. Unearned service revenue still unearned, $500. b. Prepaid rent still in force, $2,000. c....
-
In what regions are the following series uniformly convergent? Absolutely convergent? (a) - (1-2)71 2z (c) En=1 n2-z2
-
Describe the banking industries main competitors? Describe how they contribute to banking system. Why they contribute to banking system. Discuss critically with examples.
-
You are the new analyst hired by In N Out Burger Inc. and your supervisor has asked you to calculate the APR and the r EAR of non-free trade credit based on the terms provided by the company's...
-
List down information that a lender examines when assessing a borrower's capacity. Explain the importance of cash flow in determining creditworthiness.
-
Discuss how the law and the code of ethics work together to guide ethical behaviour. For example: If I meet the requirements of the Corporations Act , does that mean I'm ethical?
-
Share what we learn from the data and information collected for this discussion. Interpret each of the ratios. Review the Financial Ratios Guidelines document for direction. Do you see any red flags?...
-
4. A 20 light bulb and a 10 2 light bulb are placed in parallel with one another in a circuit (along with a battery). All three circuit elements are parallel with each other. In this situation...
-
Which of the ocean zones shown would be home to each of the following organisms: lobster, coral, mussel, porpoise, and dragonfish? For those organisms you identify as living in the pelagic...
-
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?
-
True or False: Inflation decreases the purchasing power of money.
-
Logan is conducting an economic evaluation under inflation using the then-current approach. If the inflation rate is \(j\) and the real time value of money rate is \(d\), which of the following is...
-
What is a good working definition of inflation in 10 words or less?
Study smarter with the SolutionInn App