title: write header rows to csv python
body: <p>How do I add headers to row one in a csv? </p>
  
  <p>My solution currently appends everything</p>
  
  <p>Something like: <code>writer.writerow(['DataA', 'DataB', 'DataC', 'DATA D'])[0]</code></p>
  
  <p>I feel like there an easy way of doing this and I'm overlooking the obvious.</p>
  
  <p>I've looked at a lot of examples online but am still struggling as to how you can easily do this in a csv.</p>
  
  <p>As an example lets say I wanted to scrape data of SO - load up selenium, write that into four columns and do this for 20 pages.  I'd want to write the headers to row 1 each time and then append the scraped data </p>
  
  <pre><code>with open('C:\\fa.csv', 'a+', newline='', encoding="utf-8") as outfile:
      writer = csv.writer(outfile)
      writer.writerow(['DataA', 'DataB', 'DataC', 'DataD'])
      for row in zip(ZAW_text, RESULTS1, RESULTS):
          writer.writerow(row)
          #writer.writerows({'Date': row[0], 'temperature 1': row[1], 'temperature 2': 0.0} for row in writer)
          print(row)
  </code></pre>