handle_file.py 文件源码

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

项目:lykops-old 作者: lykops 项目源码 文件源码
def xls(self):
        from xlwt import Workbook

        filename = self.filename_front + '.xls'
        wb = Workbook(encoding='utf-8')  
        wb_sheet = wb.add_sheet("sheet1")
        for title in self.title_list:
            wb_sheet.write(0, self.title_list.index(title), title)

        for line in self.query_set :
            row_no = (self.query_set.index(line) + 1)
            print(line)
            col_no = 0
            for column in line[1:] :
                if col_no == len(line) - 2:
                    # 2016-10-17 15:21:33.348313+00:00
                    re.split('\.' , str(column))[0]
                wb_sheet.write(row_no, col_no, column)
                col_no += 1
                # wb.write(?, ?, ??)
        return filename
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号