摘要: threading 模块例子 1. join 的作用 等待线程运行结束 不加 join() import threading import time def get_excute_time(fun): def wrapper(*args): start = time.time() fun(*args 阅读全文
posted @ 2022-08-13 23:31 绣幕 阅读(21) 评论(0) 推荐(0) 编辑
摘要: 两种获取链接响应码的方法 (python实现) 背景: 工作中需要测试某个包是否正常上传到了 yum 仓库,所以需要检测对应地址是否有效,发现之前使用requests 库写的代码出奇的慢,所以做了优化。 分别使用 requests 和 urllib 库实现 结论:使用urllib 库要比 reque 阅读全文
posted @ 2022-08-13 22:50 绣幕 阅读(126) 评论(0) 推荐(0) 编辑