-1
with open('recent_tweets_bmw.csv', 'wb', '\r\n') as csvfile: 1
wf = csv.writer(csvfile, delimiter=',', quotechar='"')
for tweet in tweets:
wf.writerow(['bmw', tweet['text'].encode("utf-8")])[enter image description here][1]
Traceback (most recent call last) in() 4 # to handle text encoding challenges 5 ----> 6 with open('recent_tweets_bmw.csv', 'wb', '\r\n') as csvfile: 7 8我怎麼仍然得到一個錯誤代碼,我已經複製這個複製單詞並仍然有問題...任何人都得到這個之前?
TypeError: an integer is required
我試圖進入代碼的方式,但只是發現它是無效的關鍵字? ---------------------------------------------- ----------------------------- TypeError Traceback(最近呼叫的最後一個) in () 1 import csv ----> 3 open('name-brands.csv','w',newline ='r \ n')as csvfile: 4 wf = csv.writer(csvfile ,delimiter =',', 5 quotechar ='「') TypeError:'newline'是此函數的無效關鍵字參數 –
您似乎在使用python2,儘管將問題標記爲python-3.x。你應該將開放模式設置爲'Uw'或'Uwb'? –
謝謝!得到它了。 –