第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

TypeError:“ newline”是此函數(shù)的無效關(guān)鍵字參數(shù)。

TypeError:“ newline”是此函數(shù)的無效關(guān)鍵字參數(shù)。

素胚勾勒不出你 2021-05-15 19:39:06
我編寫了以下提取信息的代碼。文件并根據(jù)其第二列對(duì)象按字母順序排序:import csvimport operatorimport sysdef re_sort(in_file='books.csv', out_file='books_sort.csv'):    data = csv.reader(open('books.csv', newline=''), delimiter=',')    header = next(data)    sortedlist = sorted(data, key=operator.itemgetter(1))    with open("books_sorted.csv", "w", newline='') as csvfile:        cvsWriter = csv.writer(csvfile, delimiter=',')        cvsWriter.writerow(header)        cvsWriter.writerows(sortedlist)每當(dāng)我嘗試在命令行上運(yùn)行此代碼時(shí),都會(huì)出現(xiàn)錯(cuò)誤TypeError:'newline'是此函數(shù)的無效關(guān)鍵字參數(shù)。你們看到發(fā)生這種情況的原因了嗎?以下是文件中內(nèi)容的結(jié)構(gòu)化版本:Title,            Author,        Publisher,  Year,  ISBN-10,   ISBN-13Automate the...,  Al Sweigart,   No Sta...,  2015,  15932...,  978-15932...Dive into Py...,  Mark Pilgr..., Apress,     2009,  14302...,  978-14302..."Python Cook...,  "David Bea..., O'Reil...,  2013,  14493...,  978-14493...Think Python...,  Allen B. D..., O'Reil...,  2015,  14919...,  978-14919..."Fluent Pyth...,  Luciano Ra..., O'Reil...,  2015,  14919...,  978-14919...
查看完整描述

1 回答

  • 1 回答
  • 0 關(guān)注
  • 135 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)