title: How to split a file by every n lines?
body: <p>I know to split a file by lines, you can do <code>f.readlines()</code>, but what if I was trying to split a file by every n lines? For example, I have a file</p>
  <pre><code>line1
  line2
  line3
  line4
  line5
  line6
  line7
  line8
  </code></pre>
  <p>instead of looping through it line by line, I want to loop through it by every two lines, so it would output</p>
  <pre><code>line1
  line2
  
  line3
  line4
  </code></pre>
  <p>etc</p>