mirror of
https://github.com/lllin000/PaperForge.git
synced 2026-07-22 17:00:23 +00:00
20 lines
472 B
Python
20 lines
472 B
Python
from __future__ import annotations
|
|
|
|
import sys
|
|
from typing import Any
|
|
|
|
from tqdm import tqdm
|
|
|
|
|
|
def progress_bar(iterable, desc: str = "", total: int | None = None, disable: bool = False) -> Any:
|
|
return tqdm(
|
|
iterable,
|
|
desc=desc,
|
|
total=total,
|
|
disable=disable,
|
|
ascii=True,
|
|
file=sys.stderr,
|
|
unit="item",
|
|
mininterval=1.0,
|
|
bar_format="{l_bar}{bar}| {n_fmt}/{total_fmt} [{elapsed}<{remaining}]",
|
|
)
|