我从javatpoint.com尝试了这段代码
代码
# Import the xlrd module
import xlrd
# Define the location of the file
loc = ("C:\\Users\User\\Desktop\\Book1.xlsx")
# To open the Workbook
wb = xlrd.open_workbook(loc)
sheet = wb.sheet_by_index(0)
# For row 0 and column 0
sheet.cell_value(0, 0)
我的Excel表格
预期产量
Name
但产出是有限的
>Python excel_001.py
>
程序执行时没有任何错误
我没有打印它。我加了一份打印声明
为什么不尝试将excel工作表作为python中的数据框架来读取呢
相关问题 更多 >
编程相关推荐