AttributeError: '_csv.reader' object has no attribute 'next' 我在使用pyhon3.4執行以下程式碼時報錯:AttributeError:
我在使用pyhon3.4執行以下程式碼時報錯:AttributeError: '_csv.reader' object has no attribute 'next'
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
|
解決方案:
For version 3.2 and above
Change: csv_file_object.next()
To: next(csv_file_object)
then I get another error:
_csv.Error: iterator should return strings, not bytes (did you open the file in text mode?)
Edit: Figured it out needed to change rb to rt
Finally, it works.
REF.