擅长:python、mysql、java
<p>实际上,我非常喜欢在python中使用csv,只使用常规格式。你知道吗</p>
<p>比如:</p>
<pre><code>rows = content.split("\n") # get the rows (content in this example would be result of .read()
for row in rows:
values = row.split(",") # get row values
</code></pre>
<p>要根据示例添加行,可以使用以下方法:</p>
<pre><code>row = "{},{},{},{},{},{}\n".format(EmployeeID, EmployeeName, EmployeeDep, EmployeeDes, EmployeeStartDate, EmployeeStatus)
with open(output, "a") as f:
f.write(row)
</code></pre>