![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python3
全栈编程网
这个作者很懒,什么都没留下…
展开
-
openpyxl 导出Excel慢问题
概述:在做python项目是,运用openpyxl 导出1万条数据要十几秒,导致接口超时报错。代码对比:慢代码: 以下代码导出1万条数据,接口耗时超过40秒。@action(methods=["get"], detail=False, url_path='export-excel') def export_excel(self, request): type = request.query_params.get('type', None) ...原创 2022-05-07 15:58:42 · 1223 阅读 · 0 评论 -
Python3 date处理
常用时间处理方法今天 today = datetime.date.today()昨天 yesterday = today - datetime.timedelta(days=1)上个月 last_month = today.month - 1 if today.month - 1 else 12当前时间戳 time_stamp = time.time()时间戳转datetime datetime.datetime.fromtimestamp(time_stamp)datetime转时间戳 in原创 2022-04-15 10:46:32 · 300 阅读 · 0 评论