I wanted to search a word exactly and print line using python file handling
<p>I have file that contains :</p>

<pre><code>"1 2 3 4 5 5 6  searching new
 1 2 3 4 5 5 6  search"
 1 2 3 4 5 5 6  search and"
</code></pre>

<p>code:</p>

<pre><code>with open('largeFile', 'r') as inF:
 for line in inF:
    if 'search' in line:
    # do_something 
</code></pre>

<p>I am getting both the lines I want only second line.</p>
