import random numbers = [random.uniform(0, 2.8) for i in range(100)] numbers[:5] [2.6575636572230916, 0.1286674965830302, 1.0634250104041332, 1.1760969844376505, 0.45192978568125486]
url = "https://www.python.org/ftp/python/3.9.0/Python-3.9.0.tgz" import httpx with httpx.stream("GET", url) as response: total = int(response.headers["Content-Length"]) with tqdm.tqdm(total=total) as progress: for chunk in response.iter_bytes(): progress.update(len(chunk))
files = [f"vid-{i}
.mp4"for i in range(4)] for fname in tqdm.tqdm(files, desc="files"): total = random.randrange(10**9, 2 * 10**9) with tqdm.tqdm(total=total, desc=fname) as progress: current = 0 while current chunk_size = min(random.randrange(10**3, 10**5), total - current) current += chunk_size if random.uniform(0, 1) 0.01: time.sleep(0.1) progress.update(chunk_size)