Cross platform way to read Excel files in Python?
I have some (Excel 2000) workbooks. I want to extract the data in each worksheet to a separate file.
I am running on Linux.
Is there a library I can use t开发者_StackOverflow中文版o access (read) XLS files on Linux from Python?
http://www.lexicon.net/sjmachin/xlrd.htm might work for you.
Get xlrd
from PyPI. Also go to the python-excel website to find out about (a) a tutorial (b) a discussion group (c) xlwt
and xlutils
.
[Dis]claimer: I'm the author & maintainer of xlrd
, and maintainer of xlwt
(which is a fork of pyExcelerator with bugs fixed and numerous enhancements).
The easiest way would be to run excel up under Wine or as a VM and do it from Windows. You can use Mark Hammond's COM bindings, which come bundled with ActiveState Python. Alternatively, you could export the data in CSV format and read it from that.
I've been using pyexcelerator for this purpose in the past with good results.
精彩评论