title: Writing a dictionary to a csv file with one line for every 'key: value'
body: <p>I've got a dictionary: </p>
  
  <p><code>mydict = {key1: value_a, key2: value_b, key3: value_c}</code></p>
  
  <p>I want to write the data to a file dict.csv, in this style:</p>
  
  <pre><code>key1: value_a
  key2: value_b
  key3: value_c
  </code></pre>
  
  <p>I wrote:</p>
  
  <pre><code>import csv
  f = open('dict.csv','wb')
  w = csv.DictWriter(f,mydict.keys())
  w.writerow(mydict)
  f.close()
  </code></pre>
  
  <p>But now I have all keys in one row and all values in the next row..</p>
  
  <p>When I manage to write a file like this, I also want to read it back to a new dictionary.</p>
  
  <p>Just to explain my code, the dictionary contains values and bools from textctrls and checkboxes (using wxpython). I want to add "Save settings" and "Load settings" buttons.
  Save settings should write the dictionary to the file in the mentioned way (to make it easier for the user to edit the csv file directly), load settings should read from the file and update the textctrls and checkboxes.</p>