title: How to search for a string in text files?
body: <p>I want to check if a string is in a text file. If it is, do X. If it's not, do Y. However, this code always returns <code>True</code> for some reason. Can anyone see what is wrong?</p>
  
  <pre><code>def check():
      datafile = file('example.txt')
      found = False
      for line in datafile:
          if blabla in line:
              found = True
              break
  
  check()
  if True:
      print "true"
  else:
      print "false"
  </code></pre>