Skip to content

Instantly share code, notes, and snippets.

@pidement
pidement / tqdm_threadpool.py
Created January 12, 2023 01:21 — forked from timothymugayi/tqdm_threadpool.py
How to run tqdm in multiple threads
import time
from random import randrange
from multiprocessing.pool import ThreadPool
import tqdm
def func_call(position, total):
text = 'progressbar #{position}'.format(position=position)
@pidement
pidement / spinner.py
Last active January 17, 2023 23:20
Simple spinner for long proccess
import time
from multiprocessing import Process, Value
class spinner():
def __init__(self, desc="", animation="|/-\\", end="✔", sleep=0.05):
self.text = desc
self.end = end
self.animation = animation
self.sleep = sleep
self.idx = 0