title: how to write to csv in python?
body: <p>I have a row:</p>
  
  <pre><code>row = {'A':'valueA', 'B':'valueB', 'C':'valueC'}
  </code></pre>
  
  <p>Basically I want to open a new <code>csv</code> file and write each value in its column, e.g.</p>
  
  <pre><code> ---------------------------
  |   A     |  B     |   C    |
   ---------------------------
  |  ValueA | ValueB | ValueC |
   ---------------------------
  </code></pre>
  
  <p>I am doing this:</p>
  
  <pre><code>def OandWtonew(filename, row):
  with open('Ouput1.csv', 'wt') as csvfile:
      fileout = csv.writer(csvfile, delimiter=' ', quotechar='|', quoting=csv.QUOTE_MINIMAL)
      fileout.writerow(row)
  </code></pre>
  
  <p>but the output I am getting is:</p>
  
  <pre><code> --------------------------------------------
  |   A           |  B           |  C          |
   --------------------------------------------
  |  'A':'valueA' | 'B':'valueB' | 'C':'valueC'|
   --------------------------------------------
  </code></pre>
  
  <p>All replies are much appreciated :)</p>