title: Save ongoing measurement into csv file
body: <p>I would like to store data into csv file. But the data are incrementing with time. I wrote a simple example to show the problem :</p>
  
  <pre><code>import csv
  import time
  i = 0
  with open('testfile.csv','wb') as csvfile:
      writer = csv.writer(csvfile,delimiter=';',quoting=csv.QUOTE_NONE)
      while True:
          i = i+1
          print i
          writer.writerow([i])    
          time.sleep(2)
  </code></pre>
  
  <p>When the while loop is running the csv file is not written. But when I stop the program then the data are stored in the csv file.
  Is there a possibility to keep the program running and 'force' the writing into the csv file?</p>