component_parser_excel.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:Modelingtools 作者: LMiceOrg 项目源码 文件源码
def GetExcelContent(name):
    #return {sheetindex: (sheetname, sheet UsedRange value) dict
    ctx = {}
    book = xlrd.open_workbook(name)
    if book == None:
        raise "Open Excel(%s) failed!" % name
    for i in range(book.nsheets):
        s = book.sheet_by_index(i)
        sname = s.name
        svalue = list()
        for r in range(s.nrows):
            svalue.append( s.row_values(r) )
        ctx[i] = (sname, svalue)
    return ctx

#Read Excel file content
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号