Question: Objective: Create a Python CLI script that processes a text file based on user input. Requirements: File Path Argument ( file ) : A string

Objective: Create a Python CLI script that processes a text file based on user input.
Requirements:
File Path Argument (file): A string argument for the path to the text file to be processed. Operation Argument (--operation): A choice argument to specify the type of operation to perform on the file. Options should include:
line-count (number of lines) word-count (number of words)
uppercase (convert all text to uppercase and display) contains (used with --word, check if file contains the word)
Word Argument (--word): A string argument that specifies a word to find in the file. This should only be required if the find operation is selected.
Displays error message for file not found.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!