title: Copy from a file until a certain marker string is found
body: <p>I am trying to write some code which will open <code>List1.txt</code> and copy the contents up until it sees the string <code>'John smith'</code> to <code>List2.txt</code>.</p>
  
  <p>This is what I have so far:</p>
  
  <pre><code>F=open('C:\T\list.txt','r').readlines()
  B=open('C:\T\list2.txt','w')
  BB=open('C:\T\list2.txt','r').readlines()
  while BB.readlines() == 'John smith':
      B.writelines(F)
  </code></pre>
  
  <p>Here is an example of what <code>List1.txt</code> could contain:</p>
  
  <pre><code>Natly molar
  Jone rock
  marin seena
  shan lra
  John smith
  Barry Bloe
  Sara bloe`
  </code></pre>
  
  <p>However, it doesn't seem to be working. What am I doing wrong?</p>