是否可以在 python 中格式化整个 xlsx 字体而不遍历每个单元格。如果这是可能的,哪个模块执行此操作?
2 回答

精慕HU
TA贡献1845条经验 获得超8个赞
您可以在 python 模块的帮助下读取 xls 文件以xlrd使用命令安装它。
pip install xlrd
下面是如何使用 xlrd 在 python 中打开电子表格的示例。
import xlrd
file_location = "your excel spreadsheet file location"
workbook = xlrd.open_workbook(file_location)
sheet = workbook.sheet_by_index(0)
# for printing it row by row
for col in range(sheet.ncols):
print(sheet.cell_value(0, col)) # change 0 to print different rows
如需进一步阅读,请查看链接,查看视频指南,请单击此处
添加回答
举报
0/150
提交
取消