Display all the lines in file that contain a keyword.
<p>I'm trying to create a program which reads a text file and asks for the user to input a word, the program should then print all lines containing that line..</p>

<p>This is my code at the moment:</p>

<pre><code>f = open ("G:/test.txt", "r");     
line = f.readlines()        
find_word = raw_input("Enter word here:")    
if find_word in f:    
    print find_word    
f.close()
</code></pre>
