Skip to main content

A tqdm multi-thread helper

Project description

A tqdm multi-thread helper

example

import threading
from concurrent.futures import ThreadPoolExecutor
import time

from tqdm_multi_thread import TqdmMultiThreadFactory


def demo(factory, position, total):
    with factory.create(position, total) as progress:
        for _ in range(0, total, 5):
            progress.update(5)
            time.sleep(0.001 * (position % 5 + 1))


with ThreadPoolExecutor(max_workers=20) as executor:
    tasks = range(100)
    multi_thread_factory = TqdmMultiThreadFactory()
    for i, url in enumerate(tasks, 1):
        executor.submit(demo, multi_thread_factory, i, 100)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tqdm_multi_thread-0.7-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file tqdm_multi_thread-0.7-py3-none-any.whl.

File metadata

  • Download URL: tqdm_multi_thread-0.7-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.4

File hashes

Hashes for tqdm_multi_thread-0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 81a3465d0011b6425f19a9079149e6198737182be68ba955a81f3133beab091a
MD5 678e794c6a86260a3f0efd25a1366237
BLAKE2b-256 64b0508c0ff437fabcdcb0d80a0f0238513922cabfdb9fb8b0f607f3ae95eb0e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page