Python: Ignore comma in a string while writing to csv
<p>I have a Python dictionary that I am writing onto a csv file. 
The format of the dictionary is as follows:</p>

<pre><code>{'title': u'A Preface to Democratic Theory.', 'year': u'1957'}
{'title': u'Joseph A. Schumpeter, Capitalism, Socialism, Democracy, New  York 1942', 'year': None}
</code></pre>

<p>The problem is the "comma" in the title. Since there is a comma in the key value, csv splits it into different cell. So I have Joseph A. Schumpeter in first cell , Capitalism in second cell and so on. 
Here is my code to write the csv file:</p>

<pre><code>def make_csv(mydict):
    with open('mydata.csv', 'a') as f:
    writer = csv.DictWriter(f,fieldnames=[""], delimiter=',')
    writer.writeheader()

    [f.write('{1},'.format(key, normalize(value))) for key, value in mydict.items()]
</code></pre>

<p>Can somebody help?</p>