Question
Complete the function file_split in the t07_functions.py module, and complete the testing code for the function in t07.py. file_split reads from an input file and
Complete the function file_split in the t07_functions.py module, and complete the testing code for the function in t07.py.
file_split reads from an input file and copies the contents of that file into two output files. Lines containing digits are copied to one output file, lines without digits are copied to the second output file, and empty lines are ignored.
The sample file source.txt contains:
As easy as 123! No numbers here. We're Number 1! Got no digits. 6 of one, 1/2 dozen of another. I am not a number, I am a free man! Got my BFG9000.
which is split into two files, the first containing lines with digits:
As easy as 123! We're Number 1! 6 of one, 1/2 dozen of another. Got my BFG9000.
and the second lines without digits:
No numbers here. Got no digits. I am not a number, I am a free man!
Complete the testing for file_split in the t07.py module by working with the appropriate files and calling the function. The names of the output files are up to you.
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