title: Trying to find efficient ways to remove headers in fasta files
body: <p>I wrote an ugly code which removes the fasta header and creates a variable with the protein sequence as a string. How could I do this more efficient? Is there a good way how to do this in biopython? </p>
  
  <pre><code>f = open('protein1.fasta', 'r')
  raw_samples = f.readlines()
  f.close()
  
  samples = ''
  
  for elem in raw_samples:
      if elem[0] == '&gt;':
          raw_samples = elem[1:].rstrip()
      else:
          samples += elem.rstrip()
  
  print samples 
  </code></pre>