title: find lines from a file with the content of another file Python
body: <p>So.. here's what i'm trying to do..
  For each line in the datafile, check if the other file contains this string.</p>
  
  <p>I tried some stuff from other posts, but non of them were any good.</p>
  
  <p>The code below says it didnt find any of the string it was looking for, even while they were present somewhere in the file.</p>
  
  <pre><code>def search():
      file1= open('/home/example/file1.txt', 'r')
      datafile= open('/home/user/datafile.txt', 'r')
  
      for line in datafile:
          if line in file1:
              print '%s found' % line
          else:
              print '%s not found' % line
  
  search()
  </code></pre>