Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Text File: From fairest creatures we desire increase, That thereby beauty's rose might never die, But as the riper should by time decease, His tender
Text File:
From fairest creatures we desire increase, That thereby beauty's rose might never die, But as the riper should by time decease, His tender heir might bear his memory: But thou contracted to thine own bright eyes, Feed'st thy light's flame with self-substantial fuel, Making a famine where abundance lies, Thy self thy foe, to thy sweet self too cruel: Thou that art now the world's fresh ornament, And only herald to the gaudy spring, Within thine own bud buriest thy content, And, tender churl, mak'st waste in niggarding: Pity the world, or else this glutton be, To eat the world's due, by the grave and thee. When forty winters shall besiege thy brow And dig deep trenches in thy beautys field, Thy youths proud livery, so gazd on now, Will be a tatterd weed, of small worth held: Then being askd, where all thy beauty lies, Where all the treasure of thy lusty days, To say, within thine own deep-sunken eyes, Were an all-eating shame and thriftless praise. How much more praise deservd thy beautys use, If thou couldst answer This fair child of mine Shall sum my count, and make my old excuse, Proving his beauty by succession thine! This were to be new made when thou art old, And see thy blood warm when thou feelst it cold. the options should be passed as user input (the program should prompt the user). Thank you!Part 1 45 points head-tail = 10 pts, splits 20 pts, and wc = 15 pts. Write a complete Python program with prompts for the user to get the main text file (checks that it exists, and if not, output an error message and stop), for any possible flags (including none), and for any other input that this program may need from the user: split has an option of naming the smaller files. Your program will open the input file once only (opening it for the program wc more than once will you cost ALL for this section!). list the first 10 lines (default) and the last 10 lines (default) in order of the given text file head_tail flag: output # lines instead of default lines Comment If the file has less than 20 lines (default), output the entire file split flags split a text file into smaller pieces put # lines of text into each output file (default= 1000 lines) input file name file to be split (note extension and use it on split files) file of newfiles (example: name-aa.ext, name-ab.ext, etc.) name may be blank, so the files are: xaa.ext, xab.ext, etc Comment: Output the name of the file as it is being created WC count characters, lines, and words in a text file output order: lines words characters Part 1 45 points head-tail = 10 pts, splits 20 pts, and wc = 15 pts. Write a complete Python program with prompts for the user to get the main text file (checks that it exists, and if not, output an error message and stop), for any possible flags (including none), and for any other input that this program may need from the user: split has an option of naming the smaller files. Your program will open the input file once only (opening it for the program wc more than once will you cost ALL for this section!). list the first 10 lines (default) and the last 10 lines (default) in order of the given text file head_tail flag: output # lines instead of default lines Comment If the file has less than 20 lines (default), output the entire file split flags split a text file into smaller pieces put # lines of text into each output file (default= 1000 lines) input file name file to be split (note extension and use it on split files) file of newfiles (example: name-aa.ext, name-ab.ext, etc.) name may be blank, so the files are: xaa.ext, xab.ext, etc Comment: Output the name of the file as it is being created WC count characters, lines, and words in a text file output order: lines words characters
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