1
我試圖創建一個CSV文件。我輸入代碼爲蟒蛇IDLE Python版本3.4.3,並得到以下 (我不明白爲什麼我得到類型錯誤:「海峽」,還有我的COE沒有STR型)試圖創建CSV文件,不斷得到TypeError:'str'不支持緩衝區接口
with open('eggs.csv', 'wb') as csvfile:
spamwriter = csv.writer(csvfile, delimiter=' ',
quotechar='|', quoting=csv.QUOTE_MINIMAL)
spamwriter.writerow([3,4])
spamwriter.writerow([6,7])
Traceback (most recent call last):
File "<pyshell#54>", line 4, in <module>
spamwriter.writerow([3,4])
TypeError: 'str' does not support the buffer interface