创建Excel文件时替换xlrd的任何其他方法

问题描述

我尝试创建一个像这样的Excel文件 enter image description here

我的代码就像

book = xlrd.open_workbook(excel_path)  # 打开一个wordbook
copy_book = copy(book)
sheet_copy = copy_book.get_sheet("Sheet1")
for index,one in enumerate(words_num):
   word_f = one[0]
   pdf_name = one[1]
   for ind,word in enumerate(keyWords):
      sheet_copy.write(index + 1,ind + 3,str(word_f[word]))
        
   sheet_copy.write(index + 1,pdf_name)
copy_book.save(excel_path +".牛人"+year + ".xls")

words_num是列表中的元组,因此one [0]是字典dict。我尝试使用csv的方式,但不知道如何处理索引部分。任何人都可以给点建议吗?谢谢

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)