Openpyxl.utils.exceptions.IllegalcharacterError

后端 未结 3 2276
遥遥无期
遥遥无期 2021-01-05 15:19

I have the following python code to write processed words into excel file. The words are about 7729

From openpyxl import *
book=Workbook ()
sheet=book.active
         


        
3条回答
  •  遥遥无期
    2021-01-05 15:38

    You missed to add the value for cell sheet.cell (row=1,column=x+1).value =

    Try like this

    from openpyxl import *
    book = Workbook ()
    sheet = book.active
    sheet.title = "test"
    for x in range (7):
        sheet.cell (row=1,column=x+1).value = "Hello"
    book.save ('test.xlsx')
    

提交回复
热议问题