Question
(6 points) Write a python script that will copy a file (.txt) from one folder to another, and demonstrate a practical example of using a
(6 points) Write a python script that will copy a file (.txt) from one folder to another, and demonstrate a practical example of using a hash.
-
Part 1: Write a script to copy a file from one directory to another. Use a SHA256 hash to confirm that the file copied cleanly into it's new location.
-
Part 2: Expand your script with a command line argument that will scramble a single byte in the copied file. Demonstrate that the hashes are of the two files are now different.
-
Some detailed requirements:
-
Use argparse for argument parsing. Your argument should be named -scramble.
-
Comment your code for full credit
-
Your code should have help text and I should be able to understand it easily.
-
Your code should work with native Python 3 libraries
-
Do not change the file name when copying it.
-
Please answer the question: Did changing a single byte in the file change the content of the file? Was the file still usable? Why or why not? Please answer as "Yes, always", "Sometimes", "No, never" and explain why.
-
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started