2 Star 1 Fork 0

RogerAbyss / 国际化

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
XlsFileUtil.py 673 Bytes
一键复制 编辑 原始数据 按行查看 历史
RogerAbyss 提交于 2018-06-21 16:42 . init
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import xlrd
import sys
import os
class XlsFileUtil:
'xls file util'
def __init__(self,filePath):
self.filePath = filePath
# get all sheets
reload(sys)
sys.setdefaultencoding('utf-8')
self.data = xlrd.open_workbook(filePath)
def getAllTables(self):
return self.data.sheets()
def getTableByIndex(self,index):
if index >= 0 and index < len(self.data.sheets()):
return self.data.sheets()[index]
else:
print("XlsFileUtil error -- getTable:index")
def getTableByName(self,name):
return self.data.sheet_by_name(name)
1
https://gitee.com/rogerabyss/internationalization.git
git@gitee.com:rogerabyss/internationalization.git
rogerabyss
internationalization
国际化
master

搜索帮助