gray0 最近的时间轴更新
gray0

gray0

V2EX 第 681763 号会员,加入于 2024-03-25 09:40:55 +08:00
gray0 最近回复了
3 天前
回复了 gosky 创建的主题 Python Python asyncio 中怎么执行 cpu 密集型任务?
何必多 BB 直接上代码

from concurrent.futures import ProcessPoolExecutor
import asyncio

async def integration_process_and_gather():
with ProcessPoolExecutor() as process_pool:
loop = asyncio.get_running_loop()
numbers = [100000000, 1, 100, 10000, 1000000, 1000, 100000]
tasks = [
loop.run_in_executor(process_pool, do_count_number, n) for n in numbers
]
[print(type(task)) for task in tasks]
results = await asyncio.gather(*tasks)
print(f"integration_hello_world {results}")
8 天前
回复了 blueeon 创建的主题 奇思妙想 开一个失业者的咖啡馆怎么样?
想给房东装修队送钱就直说,不如送我
11 天前
回复了 yinshaojun96 创建的主题 程序员 Java 写腻了 想做点小东西 有什么推荐
@goodspb 博客赚不了钱. 三大项更是学生时代应该搞的东西(35 岁迫在眉睫,不应该这么悠闲),不如赌一把,哈哈
11 天前
回复了 yinshaojun96 创建的主题 程序员 Java 写腻了 想做点小东西 有什么推荐
如果我掏出 Map map 和 JSONObject ,阁下又该如何应对?
21 天前
回复了 gray0 创建的主题 分享发现 给大家推荐个开源的 windows 翻译软件,好用
@walkbox 右键软件->偏好设置->OCR 服务 -> +号 ->PaddleOCR ->检查数据包
21 天前
回复了 gray0 创建的主题 分享发现 给大家推荐个开源的 windows 翻译软件,好用
@IDKAFK 我也是用了一段时间,然后更新了下新版,发现好多了,然后才出来推荐一波
感谢作者我也用了好多年了
啊?这么强都找不到工作
29 天前
回复了 wanchenyi 创建的主题 Python Python3 爬虫请教
+线程 = +下载速度,这个不相等吧 ,莫名其妙啊老哥
下载视频可以试试开源项目
https://github.com/soimort/you-get
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2590 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 18ms · UTC 02:12 · PVG 10:12 · LAX 19:12 · JFK 22:12
Developed with CodeLauncher
♥ Do have faith in what you're doing.