使用Python解析Excel

Posted by 4Aiur on 04/06/2010 in Python |

使用Python解析Excel 解析Excel文件常用的module有pyExcelerator与xlrd,目前这两个模块只能支持excel2004以下版本生成的文件。 我写了一个从excel文件读取工资,并给员工发送工资条邮件的程序放在了github上,里面有一些解析excel文件细节的代码,有兴趣的同学可以下回去看看。 代码存放地址: https://github.com/mlf4aiur/payslip pyExcelerator范例 查看pyExcelerator的tools中xls2txt.py了解到pyExcelerator使用parse_xls方法解析excel文件。 调用parse_xls方法后,生成的结果为list,list的结构示例如下: [(u’Sheet1′, {(0, 0): 111, (0, 1): 112, (1, 0): 121, (1, 1): 122}), (u’Sheet2′, {(0, 0): 211, (0, 1): 212, (1, 0): 221, (1, 1): 222}), (u’Sheet3′, {})] 安装pyExcelerator sudo pip install pyExcelerator localhost:Share 4aiur$ ipython Leopard libedit detected. Python 2.6.1 (r261:67515, Jul 7 2009, 23:51:51) Type […]

Tags: ,

Copyright © 2010-2024 4Aiur All rights reserved.
This site is using the Desk Mess Mirrored theme, v2.5, from BuyNowShop.com.