Easy to use Progress
with multiprocessing
module
#3658
-
First off, I wanted to thank everyone involved with developing and maintaining I've recently been toying with the idea of extending import time
import random
from concurrent.futures import ProcessPoolExecutor
from multiprogress import MultiProgress, progress_bar
def do_work(n: int) -> int:
sleep_for = random.randint(0, 2)
for _ in progress_bar(
range(1, n + 2), desc=f"Sleeping for {sleep_for} secs for each {n} iterations."
):
time.sleep(sleep_for)
return sleep_for
def demo():
with ProcessPoolExecutor() as p, MultiProgress():
print(list(p.map(do_work, range(10)))) The idea is My question for the team is: does it make sense for something like this to be part of |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I'm not accepting new features in Rich now. Maintenance only. But I would be happy to recommend your project as this comes up quite often! |
Beta Was this translation helpful? Give feedback.
I'm not accepting new features in Rich now. Maintenance only. But I would be happy to recommend your project as this comes up quite often!