Actually the line 15, while does not disturb, does nothing, as it is from before I realized I must always return file object. So it should be removed and rest of the function unindented for clean code.
pyTony
pyMod
5,359 posts since Apr 2010
Reputation Points: 782
Solved Threads: 852
What you catched from fileinput documentation?
pyTony
pyMod
5,359 posts since Apr 2010
Reputation Points: 782
Solved Threads: 852
The action in function is based in your own code only made it run as you gave no definition off searchterm. So of course it tells accurances of = in line making it easy to test the script with bunch of Python files as arguments.
You did read fileinput documentation? I use the mention that empty files are opened and closed immediately, to pass the bad file with warning message from program
pyTony
pyMod
5,359 posts since Apr 2010
Reputation Points: 782
Solved Threads: 852