TQM使地图同步

2024-10-01 07:39:56 发布

您现在位置:Python中文网/ 问答频道 /正文

我想给我的地图功能添加一个进度条。但是在向它们添加tqdm之后,它们似乎是异步的。编码:

 print("---> First…")
 res = map(func1, tqdm(res))

 print("---> Second…")
 res = map(func2, tqdm(res))

终端输出:

---> First…   
  0%|                                        | 0/607 [00:00<?, ?it/s]
---> Second… 
100%|████████████████████████████████████████| 607/607 [00:01<00:00,
 382.76it/s] 607it [00:01, 382.76it/s]

有没有机会让它们同步?在


Tags: 进度条终端map编码itres机会first