title: Extracting sequences in Python
body: <p>I have a file that looks like this:</p>
  
  <pre><code>&gt;sequence_name_16hj51
  CAACCTTGGCCAT
  &gt;sequence_name_158ghni52
  AATTGGCCTTGGA
  &gt;sequence_name_468rth
  AAGGTTCCA
  </code></pre>
  
  <p>I would like to obtain this:
  <code>['CAACCTTGGCCAT', 'AATTGGCCTTGGA', 'AAGGTTCCA']</code></p>
  
  <p>I have a list with all the sequence names titled <code>title_finder</code>. When I try to use:</p>
  
  <pre><code>for i in range(0,len(title_finder)):
      seq = seq.split(title_finder[i])
      print seq
  </code></pre>
  
  <p>I get this traceback:</p>
  
  <pre><code>Traceback (most recent call last):
    File "D:/Desktop/Python/consensus new.py", line 23, in &lt;module&gt;
      seq = seq.split(title_finder[i])
  AttributeError: 'list' object has no attribute 'split'
  </code></pre>
  
  <p>Can somebody help me out?</p>
  
  <p>EDIT: Sometimes some sequences span multiple lines and so I get more than one string when I do it with a for loop.</p>