上一页 1 2 3 4 5 6 7 ··· 11 下一页
摘要: 代码: ``` import signal class TimeoutError(Exception): pass def timeout(seconds=10, error_message='Timeout'): def decorator(func): def wrapper(*args, ** 阅读全文
posted @ 2023-07-10 14:44 一枚码农 阅读(49) 评论(0) 推荐(0) 编辑
摘要: 解决安装了opencv-python,但 import cv2 报错。 ![image](https://img2023.cnblogs.com/blog/1224392/202307/1224392-20230705172609620-747614462.png) 需要安装: ``` pip in 阅读全文
posted @ 2023-07-05 16:02 一枚码农 阅读(9) 评论(0) 推荐(0) 编辑
摘要: ``` import gzip from io import BytesIO from flask import jsonify, after_this_request, request @app.get("/book") def get_book(): """ to get all books " 阅读全文
posted @ 2023-06-19 10:24 一枚码农 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 可以用非root用户创建定时任务 Linux crontab 是用来定期执行程序的命令。 当安装完成操作系统之后,默认便会启动此任务调度命令。 crond 命令每分钟会定期检查是否有要执行的工作,如果有要执行的工作便会自动执行该工作。 **注意**:新创建的 cron 任务,不会马上执行,至少要过 阅读全文
posted @ 2023-06-10 14:55 一枚码农 阅读(59) 评论(0) 推荐(0) 编辑
摘要: 需要使用第三发包 tqdm 安装 `pip install tqdm` 效果展示 ![image](https://img2023.cnblogs.com/blog/1224392/202305/1224392-20230528142235781-1790026839.png) 简单文件下载代码 ` 阅读全文
posted @ 2023-05-28 14:25 一枚码农 阅读(12) 评论(0) 推荐(0) 编辑
摘要: 上周接到了一个这样的需求,有几千个xml文件需要解析入库,每个文件里边有三万条数据。解析出来后要按表字段,重新组成需要的数据,不能直接将解析后的json入库。 一开始我觉得这个事挺简单的,直接动手写了个demo,用随机选了两个xml文件测一下,没问题,成功入库。从解压xml到最后的数据入库,一个文件 阅读全文
posted @ 2023-05-28 10:28 一枚码农 阅读(15) 评论(0) 推荐(0) 编辑
摘要: #### 代码 ``` import asyncio async def run(i): print(i) await asyncio.sleep(i) print(333333333, i) if __name__ == '__main__': loop = asyncio.get_event_l 阅读全文
posted @ 2023-05-26 15:30 一枚码农 阅读(8) 评论(0) 推荐(0) 编辑
摘要: ### 下载mango数据库 `https://www.runoob.com/mongodb/mongodb-window-install.html` ### 程序调用 #### 安装依赖 `pip install pymongo` #### 简单使用 ``` import pymongo # Co 阅读全文
posted @ 2023-05-24 10:26 一枚码农 阅读(12) 评论(0) 推荐(0) 编辑
摘要: 定义 from flask import Blueprint from . import dataApi def register_url(): bp = Blueprint('layers', __name__, url_prefix='/<regex("[0-9a-zA-Z-]+"):syste 阅读全文
posted @ 2023-05-05 17:24 一枚码农 阅读(23) 评论(0) 推荐(0) 编辑
摘要: nuitka将python源码转成C++(这里得到的是二进制的pyd文件,防止了反编译),然后再编译成可执行文件。提高安全性和运行速度。 github:https://github.com/2267770481/cython_test 安装 pip install nuitka pip instal 阅读全文
posted @ 2023-04-26 19:50 一枚码农 阅读(765) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 11 下一页