#coding=utf-8
import xlrd
#路徑前加 r,讀取的文件路徑
file_path = r'F:/test.xlsx'
#文件路徑的中文轉碼
file_path = file_path.decode('utf-8')
#獲取數據
data = xlrd.open_workbook(file_path)
#獲取sheet
table = data.sheet_by_name('Sheet1')
#獲取總行數
nrows = table.nrows
#獲取總列數
ncols = table.ncols
#獲取一行的數值,例如第5行
rowvalue = table.row_values(5)
#獲取一列的數值,例如第6列
col_values = table.col_values(6)
#獲取一個單元格的數值,例如第5行第6列
cell_value = table.cell(5,6).value
print(rowvalue)
print(col_values)
