zipfly
zipfly copied to clipboard
Progress indicator
Is it possible to get any progress information while looping through the generator?
Yes, what is the use case?
I create a big zip file which I then save to disk. I would like to show a progress indicator while the file is saving. I'd like a real progress indicator, not a spinner.
For future reference: I used the code like
counter = itertools.count() # https://stackoverflow.com/a/6309645/2404492
zipfly_object.paths = (i for i, v in zip(zipfly_paths, counter))
i.e. I made Zipfly paths list a generator from real paths list zipped with a counter. So whenever generator consumes an element, the counter value is incremented.