MultiThreading: Thread + Queue
Project description
Multi Threading
Example Class
import multithreading
class Demo(multithreading.MultiThread):
def task(self, task):
print(task)
Example Main
task_list = range(1, 3 + 1)
demo = Demo(task_list, threads=3)
# Start
demo.start()
Result
1
2
3
OR
demo = Demo(threads=3)
# Start threads
demo.start_threads()
# Adding task to queue
demo.add_task(1)
demo.add_task(2)
demo.add_task(3)
Result
1
2
3
Install
$ pip install multithreading
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
multithreading-0.1.1.tar.gz
(4.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file multithreading-0.1.1.tar.gz.
File metadata
- Download URL: multithreading-0.1.1.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
926286ecac8450aa92d3b5a47cf434e28d6b0d7edc22118f44dc7c1e29a751a5
|
|
| MD5 |
2274db940f27c333ae6cb48c8475527b
|
|
| BLAKE2b-256 |
d1858748d5f0e10b30f15518599f8d745adeb56e2504726913dda8f976a30752
|
File details
Details for the file multithreading-0.1.1-py3-none-any.whl.
File metadata
- Download URL: multithreading-0.1.1-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
efc68e32f91ee397a2c9d3e81c425ae478ad1412f8a6109c10e2fa52dd42a4f9
|
|
| MD5 |
45f31e39713597b8cfcf1f17be435f1c
|
|
| BLAKE2b-256 |
2ffcfd833ae5dac9a83ffb667ff286ee35d029b21fc1e449c93ec51b46358a47
|