progress_bar()¶
- audeer.progress_bar(iterable=None, *, total=None, desc=None, disable=False, maximum_refresh_time=None)[source]¶
Progress bar with optional text on the right.
If you want to show a constant description text during presenting the prgress bar, you can use it similar to:
for file in progress_bar(files, desc="Copying"): copy(file)
When the text should be updated as well, you have to explicitly do that in each step:
with progress_bar(files) as pbar: for file in pbar: desc = format_display_message( f"Copying {file}", pbar=True, ) pbar.set_description_str(desc) pbar.refresh() copy(file) pbar.update()
- Parameters
- Return type
tqdm
- Returns
progress bar object