Python Excel 介绍
顾名思义,该项目是 Python 用来处理 Excel 文档的开发包,无需 Windows 以及 Excel 环境的支持。
该项目包含五个子项目:
- openpyxl http://pypi.python.org/pypi/openpyxl
- xlsxwriter https://gitee.com/mirrors/XlsxWriter
- xlrd https://gitee.com/mirrors/xlrd
- xlwt https://gitee.com/mirrors/xlwt
- xlutils https://gitee.com/mirrors/xlutils
示例代码:
from openpyxl import Workbook wb = Workbook() # grab the active worksheet ws = wb.active # Data can be assigned directly to cells ws['A1'] = 42 # Rows can also be appended ws.append([1, 2, 3]) # Python types will automatically be converted import datetime ws['A2'] = datetime.datetime.now() # Save the file wb.save("sample.xlsx")
Python Excel 官网
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。