title: Reading Error line from multiple files in python
body: <p>I want read error line form multiple files using python. these files are in .log format.</p>
  <p>I can read error when I hardcode the path of a particular file. Using below code</p>
  <pre><code>file_in = open('C:\\Users\\Rahul\\AppData\\Roaming\\JetBrains\\PyCharmCE2021.3\\test.log','r') # Read file
  for line in file_in: # Loop every line
      if 'ERROR' in line: # Search for ERROR in line
          print(line) # Print line
      else: # Remove INFO and WARN lines
          pass # Print line
  </code></pre>
  <p>However I want to read it from multiple files at once. like I have 5 files and I want to read error line in each of these files. Below is code I am working .</p>
  <pre><code>import glob
  
  file_list = glob.glob('C:\\Users\\Rahul\\AppData\\Roaming\\JetBrains\\PyCharmCE2021.3\\*.log')
  
  my_list = []
  path = &quot;C:\\Users\\Rahul\\AppData\\Roaming\\JetBrains\\PyCharmCE2021.3\\*.log&quot;
  for file in glob.glob(path):
      print(file)
  file_in=open('C:\\Users\\Rahul\\AppData\\Roaming\\JetBrains\\PyCharmCE2021.3\\outbrain_sample_failed.log','r') # Read file
  for line in file_in: # Loop every line
      if 'ERROR' in line: # Search for ERROR in line
          print(line) # Print line
      else: # Remove INFO and WARN lines
          pass # Print line
  </code></pre>
  <p>However I am not able to read it. any suggestion or help ?</p>