title: How do I match a word in a text file using python?
body: <p>I want to search and match a particular word in a text file.</p>
  
  <pre><code>with open('wordlist.txt', 'r') as searchfile:
          for line in searchfile:
              if word in line:
                      print line
  </code></pre>
  
  <p>This code returns even the words that contain substrings of the target word. For example if the word is "there" then the search returns "there", "therefore", "thereby", etc.</p>
  
  <p>I want the code to return only the lines which contain "there". Period.</p>