xls2lua.py 文件源码

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

项目:xls2lua 作者: trumanzhao 项目源码 文件源码
def _get_cell_raw(self, cell):
        if cell.ctype == xlrd.XL_CELL_TEXT:
            return cell.value;
        if cell.ctype == xlrd.XL_CELL_NUMBER:
            number = int(cell.value);
            return u"%d" % number if number == cell.value else u"%g" % cell.value;
        if cell.ctype == xlrd.XL_CELL_DATE:
            dt = xlrd.xldate.xldate_as_datetime(cell.value, self._workbook.datemode);
            return u"%s" % dt;
        if cell.ctype == xlrd.XL_CELL_BOOLEAN:
            return  u"true" if cell.value else u"false";
        return u"";
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号