最贊回答 / carlossxu
可能是下載出錯,用清華源下載試試,在指令后面加 -i https://pypi.tuna.tsinghua.edu.cn/simplepip install python-docx?-i?https://pypi.tuna.tsinghua.edu.cn/simple
2020-08-13
講師回答 / 離島
在創(chuàng)建工作表的時候,添加cell_overwrite_ok=True例如:ws?=?wb.add_sheet("CNY",cell_overwrite_ok=True)
2020-08-08
也想要數(shù)據(jù)表,每次都要截圖手敲個數(shù)據(jù)表,能否提供下載地址?
講師回答 / 離島
檢查下構(gòu)建附件那塊的代碼,filename那些有么有加.xlsx后綴
已采納回答 / 離島
在ws.write(i+2,j,val,ztstyle) 這行這里再添加一個if判斷 ,只有第一行才應(yīng)用 ztstyle,后面不應(yīng)用,這樣第一行就是綠色 后面幾行就沒了
2020-08-03
講師回答 / 離島
insert_bitmap()僅適用于bmp格式,xlsxwriter不僅支持bmp,而且還支持jpeg和png文件,通過worksheet.insert_image
2020-08-03
講師回答 / 離島
通過python在原有數(shù)據(jù)基礎(chǔ)上進(jìn)行條件篩選,我這里用課程中的一部分代碼做了修改,通過col_values獲取到第二列的所有數(shù)據(jù)后,想要找到里面內(nèi)容等于“題目”的,通過filter進(jìn)行篩選后,進(jìn)行輸出data=xlrd.open_workbook("data2.xlsx")sheet=data.sheet_by_index(0)?#獲取到工作表cols=sheet.col_values(1)print(list(filter(lambda?item:item=='題目',cols))) #返回這一列中內(nèi)容...