python办公入门6:xlrd操作excel单元格

操作单元格

1 #打印某一个单元格
2 print(sheet.cell(3,3))
3 #两个获取单元格数据类型的方法
4 print(sheet.col_types(3,3))
5 print(sheet.cell(3,3).ctype)
6 #仅仅获取单元格中间的值
7 print(sheet.cell_value(3,3))
8 print(sheet.cell(3,3).value)

运行结果

1 number:16866.86
2 [2, 2, 2, 2, 2, 2, 2, 2, 2, 2]
3 2
When you return with glory, you will be bathed in the golden rain.
原文地址:https://www.cnblogs.com/DrunkYouth/p/14049564.html