2017-02-17 23 views

回答

-1
#you have to install the module 
#import the xlrd module 
import xlrd 
workbook = xlrd.open("example.xls") #it can take x|xs|xls format 
#if you know the name of the sheet use 
sheet = workbook.sheet_by_name("name of the sheet") 
#or you can use index number 
sheet = workbook.sheet_by_index("index of the sheet here") 
#you can print the cell you want like this 
print(" print from the 4th row 2nd cell".format(sheet(4,2).value)) 

,如果這是有益的給它一個像如果不是我不懂英語好三江源和我是新

+2

這隻能說明如何通過名稱或索引訪問工作表,而不是通過其「CodeName」。 (例如,工作表的「CodeName」可能是'shtInputData',它的'Name'可能是''Input'',其索引可能是'3'。) – YowE3K