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.6.tar.gz
(4.1 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.6.tar.gz.
File metadata
- Download URL: multithreading-0.1.6.tar.gz
- Upload date:
- Size: 4.1 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.50.0 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4723930bfee83069c98d24ff45a6c3e460dd7ec3dcb4b33a0f5ebd428d5718fb
|
|
| MD5 |
a069cc896c4e92a071c701d33619a30e
|
|
| BLAKE2b-256 |
501499e0bc4d302908f8b64d130511cf728c4417f92d6b517e29c1ec46991deb
|
File details
Details for the file multithreading-0.1.6-py3-none-any.whl.
File metadata
- Download URL: multithreading-0.1.6-py3-none-any.whl
- Upload date:
- Size: 5.7 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.50.0 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f78740b37bd63e2fb5bb4032cdbff4d751826b0f8b410b7b41797e6413f9c036
|
|
| MD5 |
1e3f5e4603ac89d4d4ad955160f4da53
|
|
| BLAKE2b-256 |
3be8522e6f58c8372379e781442417e007598942cc9d145791d427e9af9c1198
|