天天看點

python寫入檔案錯誤

在一次項目中,當執行 writer.writerow(idItem)的時候報錯: _csv.Error: sequence expected 原因: writerow方法隻識别list或者一個 tuple  是以将代碼改為 writer.writerow([idItem])即可