From what I've seen progress bars mostly work by wrapping an iterable or something the like. I'm trying to get a progress bar from a callback function from another module.
The module is doing calculating on data and you can define a callback that uses three arguments: (file being worked on, current piece, total pieces)
Just for fun I did this:
def callback(filename, pc, num_pieces):
print(f'{filename} - {pc} - {num_pieces}')
As expected, you get thousands of prints with increasing piece number: The file name also changes during the progress, but it's not important for my purposes.
How would you define and use the callback to create a progress bar for a CLI application?
tqdm.updateafter each invocation of the callback?