mytools.py 文件源码

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

项目:chat 作者: Decalogue 项目源码 文件源码
def read_excel(filepath):
    """Get excel source

    Args:
        filepath: The full path of excel file. excel???????

    Returns:
        data: Data of excel. excel???
    """
    is_valid = False
    try:
        if os.path.isfile(filepath):
            filename = os.path.basename(filepath)
            if filename.split('.')[1] == 'xls':
                is_valid = True
        data = None
        if is_valid:
            data = xlrd.open_workbook(filepath)
    except Exception as xls_error:
        raise TypeError("Can't get data from excel!") from xls_error
    return data
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号