擅长:python、mysql、java
<p>你可以像写普通文件一样写这个文件。</p>
<pre><code>with open('csvfile.csv','wb') as file:
for l in text:
file.write(l)
file.write('\n')
</code></pre>
<p>如果只是以防万一,它是一个列表列表,那么可以直接使用内置的<code>csv</code>模块</p>
<pre><code>import csv
with open("csvfile.csv", "wb") as file:
writer = csv.writer(file)
writer.writerows(text)
</code></pre>