title: The glob.glob function to extract data from files
body: <p>I am trying to run the script below. The intention of the script is to open different fasta files one after the other, and extract the geneID. The script works well if I don't use the glob.glob function. I get this message <strong>TypeError: coercing to Unicode: need string or buffer, list found</strong></p>
  
  <pre><code>files='/home/pathtofiles/files'
      #print files
      #sys.exit()
      for file in files:
          fastas=sorted(glob.glob(files + '/*.fasta'))
          #print fastas[0]
          output_handle=(open(fastas, 'r+'))
          genes_files=list(SeqIO.parse(output_handle, 'fasta'))
          geneID=genes_files[0].id
          print geneID
  </code></pre>
  
  <p>I am running of ideas on how to direct the script to open when file after another to give me the require information.         </p>