用于处理Excel文件的Python库(xls | xlsx) [英] Python library for handling Excel files (xls | xlsx)
问题描述
我需要一个可以读取和写入所有格式(即xls和xlsx)的Excel文件的python库.
I need a python library that could read and write Excel files with all formats (i.e xls and xlsx).
我是python的新手,我以前使用过Java.在Java中,我使用的是 POI 库,它非常完美.如果可能,我需要具有相同功能的python库.
I'm new to python and I was using Java before. In Java I was using POI library and it was perfect. I need a python library with the same functionality if possible.
推荐答案
我知道这个线程已经有一段时间没有活动了,但是我认为在这里添加答案会很好,因为我为此提出了新的解决方案问题.
I know this thread hasn't been active in a while, but I thought it would be nice to add an answer here since I made a new solution to this problem.
我遇到了同样的问题,因此我继续创建了一个小型库,其中包含 python-excel (xlrd,xlwt)和 openpyxl .您可以在这里找到它: https://github.com/camyoung1234/spreadsheet
I had this same issue so I went ahead and created a small library that includes python-excel (xlrd, xlwt) and openpyxl within it. You can find it here: https://github.com/camyoung1234/spreadsheet
然后使用它键入与openpyxl完全相同的代码,除了将 openpyxl
替换为 spreadsheet
.加载和保存文件时,它会查看扩展名并确定用于处理该扩展名的库.
Then to use it you type the exact same code as openpyxl, except you replace openpyxl
with spreadsheet
. When you load and save files it looks at the extension and determines which library to use for handling it.
要安装它,只需下载,解压缩,将文件夹 spreadsheet-master
重命名为 spreadsheet
并将其放在 PythonXX/Lib/site-packages/
(我仅使用Python 2.7进行过测试,但它应该可以与其他人一起使用)
To install it just download it, extract it, rename the folder spreadsheet-master
to spreadsheet
and place it in PythonXX/Lib/site-packages/
(I've only tested with Python 2.7 but it should work with others)
README
中有一些示例可以帮助您入门.
The README
has a few examples to help you get started.
这篇关于用于处理Excel文件的Python库(xls | xlsx)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!