Question: Problem 1 : File Processor Objective: Create a Python CLI script that processes a text file based on user input. Requirements: File Path Argument (

Problem 1: File Processor
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.
You can create a file with the following content for testing.
Python is an interpreted, high-level and general-purpose programming
language.
Python's design philosophy emphasizes code readability with its notable
use of significant whitespace.
Its language constructs and object-oriented approach aim to help
programmers write clear, logical code for small and large-scale projects.
Python is dynamically typed and garbage-collected. It supports multiple
programming paradigms, including structured (particularly, procedural),
object-oriented, and functional programming.
Python is often described as a "batteries included" language due to its
comprehensive standard library.
 Problem 1: File Processor Objective: Create a Python CLI script that

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!