Python中一般使用xlrd库来读取Excel文件,使用xlwt库来生成Excel文件,使用xlutils库复制和修改Excel文件。这三个库只支持到Excel2003。
python-excel主页地址:http://www.python-excel.org/
xlrd
地址:https://pypi.python.org/pypi/xlrd
github地址:https://github.com/python-excel/xlrd
打开excel文件,获取一个Book()对象:
1 2 |
|
获取sheets数目:
1 2 |
|
获取sheets列表:
1 2 |
|
获取sheets name列表:
1 2 |
|
获取Book()中的Sheet:
1 2 3 |