File filtering_Python 3.2 [closed]
- by user71261
I'm trying to write a short file filtering code in Python that will find my desired string.
I've got it worked out logically, but my Command Feed is sending me an error message for the print statement. This is how it works as of now:
filename = input('give file name: ')
n = input('give desired string: ')
f = open
line = f.readline()
while line:
if n in line:
print line
line = f.readline()
Error Statement:
Traceback (most recent call last):
File "<string>", line 7, in <fragment>
Syntax Error: print line: <string>, line 718
I know this is a simple problem but the answer is not obvious to me. please help.