title: Searching "aborted" files in directory
body: <p>My code searching <code>*.lis</code> files in directory and searching <code>aborted</code> - <code>*.lis</code> files.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>def aborted_files(file):
      in_file = open(file,'r')
      for lines in in_file.readlines():
          if re.search("aborted", lines):
              print in_file
  
      in_file.close()
  
  for file in os.listdir("./"):
      if file.endswith(".lis"):
          aborted_files(file)
  </code></pre>
  
  <p>I test it in 2 files <code>lisfile1.lis</code> and <code>lisfile2.lis</code>. </p>
  
  <p>In <code>lisfile1.lis</code> I have <code>aborted</code> and the result of my code was:</p>
  
  <pre><code>&lt;open file 'lisfile1.lis', mode 'r' at 0x2b0edd174660&gt;
  &lt;open file 'lisfile1.lis', mode 'r' at 0x2b0edd174660&gt;
  </code></pre>
  
  <p>Could you help me to get as result only <code>aborted</code> - <code>*.lis</code> file names.<br>
  What is incorrect in my code?</p>