title: Python - cx_oracle print variable amount of column names
body: <p>Based on a given SQL-Statement, I extract from a database to CSV with thefollowing function:</p>
  
  <pre><code>def extract_from_db():
      with open('myfile.csv','w') as outfile:
          for row in cursor:
              outfile.write(str(row[0])+";"+str(row[1])+";"+str(row[2])+";"+str(row[3])+";"+str(row[4])+";"+str(row[5])
                 +";"+str(row[6])+";"+str(row[7])+";"+str(row[8])+";"+str(row[9])+";"+str(row[10])+";"+str(row[11])+";"+str(row[12])
                 +";"+str(row[13])+";"+str(row[14])+"\n")
  </code></pre>
  
  <p>How can I write in the beginning of the file the column names for a variable amount of columns, so that I don't have to hardcode it? Also the hardcoded concatenation is pretty ugly.</p>