Home > other >  Pyhton dealing with excel can only handle can't handle sheet2 sheet1 inside content?
Pyhton dealing with excel can only handle can't handle sheet2 sheet1 inside content?

Time:11-17

 import XLRD 

Book=XLRD. Open_workbook (" demo2. XLSX ")

Sheet1=book. Sheet_by_index (0)
Print (sheet1. Row_values (0))

Sheet2=book. Sheet_by_index (1)
Print (sheet2. Row_values (0))





This demo2, XLSX workbook with 2 table sheet1. Row_values (0) to the content of the normal output table sheet1 first line sheet2 I also get to, but in the output sheet2 table when the content of the first line shows the list index out of the range of my test table sheet1 and sheet2 first line are content, normal sheet2 why sheet1 is wrong

CodePudding user response:

No inventory table, the test is no problem
  • Related