title: Python: Delete CSV headers row and rewrite new headers row
body: <p>Still teaching myself python so please don't hate me if my code is terrible...</p>
  
  <p>My code:</p>
  
  <pre><code>ifile = csv.reader(open("TE.csv",'rb'))
  shutil.copy("TE.csv","temp")
  tempfile = csv.reader(open("temp","rb"))
  ofile = csv.writer(open("TE-RESULTS.csv","ab"))
  
  for row in ifile:
      #do some web scraping stuff here
  
      VC_s = str(cells[1].find(text=True))
      VC_i = str(cells[2].find(text=True))
      VT_s = str(cells[4].find(text=True))
  
      entry = [VC_s, VC_i, VT_s]
  
      rowAdd = tempfile.next()
      ofile.writerow(rowAdd + entry)
  </code></pre>
  
  <p>Problem: I start with a CSV that I will have to add 3 columns to the end. Using my code above, I get the following output:</p>
  
  <pre><code>HEADER1     HEADER2    HEADER3   result1   result2   result3
  autocheck   C:\check   1.jpg     result1   result2   result3
  services    C:\svcs    2.jpg     result1   result2   result3
  </code></pre>
  
  <p>My <strong><em>DESIRED</em></strong> output:</p>
  
  <pre><code>HEADER1     HEADER2    HEADER3   HEADER4   HEADER5   HEADER6
  autocheck   C:\check   1.jpg     result1   result2   result3
  services    C:\svcs    2.jpg     result1   result2   result3
  </code></pre>
  
  <p>What is the best way to fix my code that will give me the desired output? My initial thought would be to delete the HEADERS row and replace it with a new HEADERS row in the TE-RESULTS.csv file.</p>