Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a program that takes two command line arguments. The first one is the name of a file. The second one is a word.
Write a program that takes two command line arguments. The first one is the name of a file. The second one is a word. Your program should search for the word in the file specified. Here is an example: Suppose I have "input.txt" in my current working directory. The content of this file is: Hi everyone. This is a test file that I created for assignment 2. This is the beginning of the second line in the file. I am getting tired of typing!! This should be the last line. Some sample input and output of this program: 1) Arguments: input.txt assignment Output of the program: Line: 1, character: 53 2) Arguments: input.txt second Output of the program:
Step by Step Solution
★★★★★
3.46 Rating (159 Votes )
There are 3 Steps involved in it
Step: 1
Below is a simple Python program that takes two command line arguments searches for the specified wo...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