Question
Your task is to create a python script (single .py file) which will read the file fileSpec searching for the string from and, when found,
Your task is to create a python script (single .py file) which will read the file "fileSpec" searching for the string "from" and, when found, replacing it with "to".
The invocation of the script must be as follows:
python modify.py fileSpec from to where, modify.py is the name of your script
fileSpec is the name of the file to be modified (smb.txt)
from is the text to be searched for (be sure to enclose any white space in quotes.
to is the text the searched text is to be replaced with.
sample python modify.py smb.txt password sync = yes password sync = no
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