且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

用于处理Excel文件的Python库(xls | xlsx)

更新时间:2022-12-08 15:53:35

我知道这个线程已经有一段时间没有活动了,但是我认为在这里添加答案会很好,因为我为此提出了新的解决方案问题.

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.