title: Read every second line and print to new file
body: <p>I am trying to read every second line in a CSV file and print it in a new file. Unfortunately i am getting a blank line which i am unable to remove.</p>
  
  <pre><code>lines = open( 'old.csv', "r" ).readlines()[::2]
  file = open('new.csv', "w")
  n = 0
  for line in lines:
      n += 1
      if ((n % 2) == 1):
              print &gt;&gt; file, line
  </code></pre>
  
  <p>The code i am using is simply by looking at the modolus value of <code>n</code> to decide if its actually every second line or not. I have even tried with <code>strip()</code> and <code>rstrip()</code> which still takes the blank lines.</p>