title: Writing data to new row when every time it updates
body: <p>So i am trying to get this done, the script executes every 5 minutes and the variable (a &amp; b) changes with it, first time the script executes the file write the value  but next time when it runs it overwrites the previous data.I want it to write the value of (a &amp; b) in next row with overwriting the previous data.
  Tried using newline='' but got error.</p>
  <pre><code>import csv
  
  a = 1
  b = 4
  #newline=''
  with open('data.csv', mode='w') as data:
      datawriter = csv.writer(data, delimiter=',', quotechar='&quot;', quoting=csv.QUOTE_MINIMAL)
  
      datawriter.writerow([a,b])
  </code></pre>
  <p>Is there any easy fix where i can achieve it fast</p>
  <p>data it has:</p>
  <pre><code>  A         B
    1         6
  </code></pre>
  <p>Result i want when every time it runs:</p>
  <pre><code>  A         B
    1         6
    4         7
    6         2
    3         9
  </code></pre>
  <p>Any help would be appreciated</p>