PYTHON!!!! Write a script named copyFile.py. This script should prompt the user for the names of two text files. The contents of the first file should be input and written to the second file. An example of the program input is shown below: Enter the input file name: copyFrom.txt Enter the output file name: copyTo.txt Output: After running the program, a file named copyTo.txt will be outputted that contains the text from the copyFrom.txt file. The program writes the contents of the first provided file to the second provided file: Test case: Run code to create file, test 1 Input: copyFrom.txt copyTo.txt Custom test: Check contents of test file 1 Test contents: with open('copyFrom.txt', 'r') as g: org_contents = g.read() with open('copyTo.txt', 'r') as f: contents = f.read() assert(org_contents == contents) The program writes the contents of the first file to the second file: Test case: Run code to create file, test 2 Input: .inFile2.txt .outFile2.txt Custom test: Check contents of test file 2 Test contents: with open('.inFile2.txt', 'r') as g: org_contents = g.read() with open('.outFile2.txt', 'r') as f: contents = f.read() assert(org_contents == contents)
PYTHON!!!!
Write a script named copyFile.py. This script should prompt the user for the names of two text files. The contents of the first file should be input and written to the second file.
An example of the
Enter the input file name: copyFrom.txt
Enter the output file name: copyTo.txt
Output: After running the program, a file named copyTo.txt will be outputted that contains the text from the copyFrom.txt file.
The program writes the contents of the first provided file to the second provided file:
Test case:
Run code to create file, test 1
Check contents of test file 1
The program writes the contents of the first file to the second file:
Test case:
Run code to create file, test 2
Check contents of test file 2
Trending now
This is a popular solution!
Step by step
Solved in 5 steps with 4 images