|
发表于 2017-12-9 00:41:44
|
显示全部楼层
相关的模块都有使用文档的,比如:
- import xlrd
- book = xlrd.open_workbook("myfile.xls")
- print("The number of worksheets is {0}".format(book.nsheets))
- print("Worksheet name(s): {0}".format(book.sheet_names()))
- sh = book.sheet_by_index(0)
- print("{0} {1} {2}".format(sh.name, sh.nrows, sh.ncols))
- print("Cell D30 is {0}".format(sh.cell_value(rowx=29, colx=3)))
- for rx in range(sh.nrows):
- print(sh.row(rx))
复制代码
另外,请参考 -> https://zhuanlan.zhihu.com/p/23998083
然后,可以关注下咱新出炉的《极客Python之效率革命》系列课程,近期我恰好准备做关于 Excel 专题的内容 -> http://bbs.fishc.com/forum-319-1.html
|
|