擅长:python、mysql、java
<p><code>",".join(l)</code>不适用于所有情况。我建议在StringIO中使用csv模块</p>
<pre><code>import StringIO
import csv
l = ['list','of','["""crazy"quotes"and\'',123,'other things']
line = StringIO.StringIO()
writer = csv.writer(line)
writer.writerow(l)
csvcontent = line.getvalue()
# 'list,of,"[""""""crazy""quotes""and\'",123,other things\r\n'
</code></pre>