title: Python append to csv file without whiteline
body: <p>I'm writing a game in python. And after each round of the game (yes, the game has multiple rounds) I want to write the data to a CSV file. </p>
  
  <p>this is my code:</p>
  
  <pre><code>with open('data.csv', 'a') as fp:
              for player in self.players:
                  a = csv.writer(fp, delimiter=',');
                  data = [[player.name, player.penalty(), player.score()]];
                  a.writerows(data);
  </code></pre>
  
  <p>the output for this code (after two rounds) in the CSV file is:</p>
  
  <blockquote>
    <p>player1,10,10.0</p>
    
    <p>player2,5,5.0</p>
    
    <p>player1,20,15.0</p>
    
    <p>player2,10,7.5</p>
  </blockquote>
  
  <p>The problem is that every time the script appends data to the csv file, there is a white line between the data. And the only time I want to append a white line is between the rounds. So the output should look like this:</p>
  
  <blockquote>
    <p>player1,10,10.0<br>
    player2,5,5.0</p>
    
    <p>player1,20,15.0<br>
    player2,10,7.5</p>
  </blockquote>
  
  <p>Is there a way I can accomplish this?</p>
  
  <p>My new working code:</p>
  
  <pre><code>with open('take5.csv', 'ab') as fp:
              for player in self.players:
                  a = csv.writer(fp, delimiter=',');
                  data = [[player.name, player.penalty(), player.score()]];
                  a.writerows(data);
              white_row = ['\n'];
              a.writerows(white_row);
  </code></pre>