擅长:python、mysql、java
<p>使用<a href="http://docs.python.org/library/csv.html#examples" rel="nofollow noreferrer">docs.python.org</a>中的<code>csv</code>模块的示例:</p>
<pre><code>import csv
reader = csv.reader(open("some.csv", "rb"))
for row in reader:
print row
</code></pre>
<p>您只需将每一行保存到一个列表中,然后在ID3中处理它,而不需要对行进行<code>print</code>。</p>
<pre><code>database.append(row)
</code></pre>