我有这样的代码在python中编写csv文件
import csv
with open('eggs.csv', 'wb') as csvfile:
spamwriter = csv.writer(csvfile, delimiter=' ',
quotechar='|', quoting=csv.QUOTE_MINIMAL)
spamwriter.writerow(['Spam'] * 5 + ['Baked Beans'])
spamwriter.writerow(['Spam', 'Lovely Spam', 'Wonderful Spam'])
输出如图所示。现在输出中有一个额外的行(第 3 行)。如何在编写 csv 文件时删除最后一个空行。