title: Copying from a specific part of a file to another with python
body: <p>I am trying to copy a specific part of a file to another one. The input file has four lines which start by the same name ("1" in the example given). I don't know exactly how I could take only the part of the file that is between the first "1" and the second "1" (more than 100 lines...):</p>
  
  <p>·
  ·
  1
  ·
  ·
  ·
  1
  ·
  ·
  ·
  1</p>
  
  <p>I just started the following:</p>
  
  <pre><code>f_read = open(pathway, "r")
  f_write = open(pathway, "w")
  cnt = 0
  
  with f_read as f1:
      for line in f1:
         if line.startswith("1"):
            cnt =+ 1
            if cnt == 2:
               break
  </code></pre>
  
  <p>And here I do not know how to specify the part of the file I want (from the first "1" until the second "1")...</p>
  
  <p>Any ideas? 
  Thank you in advance!!</p>