python3 读写Excel
说明
- 2007版以前的Excel(xls结尾的),需要使用xlrd读,xlwt写。
- 2007版以后的Excel(xlsx结尾的),需要使用openpyxl来读写。
pypi的地址:
https://pypi.python.org/pypi/xlwt
https://pypi.python.org/pypi/xlrd
https://pypi.python.org/pypi/openpyxl
openpyxl文档地址:
举个栗子
# -*- coding: utf-8 -*-
# 读写2003 excel
import xlrd