上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 33 下一页
摘要: python翻页功能在django框架下使用 from django.core.paginator import Paginator # 数据集合 data = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10,11,12,13,14,15,16,17,18,19,20,21] per_ 阅读全文
posted @ 2024-01-25 13:16 万笑佛 阅读(48) 评论(0) 推荐(0)
摘要: 该多线程,简单计算结果可以使用,在django里想并行处理多个实体进行计算不行,请自行验证 import multiprocessing # 要在进程池中并行执行的任务函数 def process_data(data): # 执行任务的逻辑 result = data * 2 return resu 阅读全文
posted @ 2024-01-22 11:01 万笑佛 阅读(35) 评论(0) 推荐(0)
摘要: 包是python自带的不用单独安装依赖包 #coding=utf-8 import csv #导出csv文件 #filePath 例如 C:\Users\yc\Desktop\1\output.csv def exportCsv(filePath): # 打开文件 file = open(fileP 阅读全文
posted @ 2024-01-19 17:41 万笑佛 阅读(81) 评论(0) 推荐(0)
摘要: 一、conda创建新的开发环境 C:\Users\yc>conda create --name celery_django python=3.8 C:\Users\yc>conda info -e py38 * D:\ProgramData\Anaconda3\envs\py38 celery_dj 阅读全文
posted @ 2024-01-18 18:15 万笑佛 阅读(309) 评论(0) 推荐(0)
摘要: python生成word文档,感觉比java生成方便很多 下面看看步骤 1、环境 pip install python-docx 2、准备一张需要插入word中的图片monty-truth.png 3、一段代码 from docx import Document from docx.shared i 阅读全文
posted @ 2023-12-27 18:14 万笑佛 阅读(318) 评论(0) 推荐(0)
摘要: celery本文就不介绍了 感兴趣的看https://c.biancheng.net/view/s0j4eth.html 这个人家介绍的挺好的 1. 安装部署 Celery 涉及任务队列和结果存储, 我们使用 Redis,做例子前要先安装好redis。 我们可以通过命令行方式下载和安装指定版本: # 阅读全文
posted @ 2023-12-18 16:31 万笑佛 阅读(107) 评论(0) 推荐(0)
摘要: 完成Springboot配置发件邮箱,自动给其他邮箱发送邮件功能 一、创建springboot基础项目,引入依赖 <!-- Spring Boot 邮件依赖 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactI 阅读全文
posted @ 2023-11-23 17:08 万笑佛 阅读(345) 评论(0) 推荐(1)
摘要: 如果你想在 Spring Boot 启动后异步方式启动一个方法,你可以使用 Spring Framework 的异步支持和 @Async 注解来实现。以下是如何在 Spring Boot 应用程序中异步方式启动一个方法的步骤: 配置异步支持: 首先,在应用程序的主类上添加 @EnableAsync  阅读全文
posted @ 2023-10-11 13:02 万笑佛 阅读(248) 评论(0) 推荐(0)
摘要: class Test(): cursor = connection.cursor() data_to_insert = [] sql = "INSERT INTO test_t (id, name ) VALUES" """ (%s, %s) """ d = ('1', "apple") data_ 阅读全文
posted @ 2023-09-19 18:02 万笑佛 阅读(444) 评论(0) 推荐(0)
摘要: 数据有Test表,表里有id,name,ip_address,last_time四个字段 通常查询写法,返回结果会把id,name,ip_address,last_time四个字段都返回 public List selectList(Test test) { List list = testMapp 阅读全文
posted @ 2023-08-02 17:50 万笑佛 阅读(1676) 评论(0) 推荐(0)
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 33 下一页