Replies: 1 comment 8 replies
-
import time
import progressbar
widgets = [
progressbar.Percentage(),
progressbar.Bar(),
' ', progressbar.SimpleProgress(),
' ', progressbar.ETA(),
' ', progressbar.AdaptiveTransferSpeed(unit='it'),
]
bar = progressbar.ProgressBar(widgets=widgets)
for i in bar(range(100)):
time.sleep(0.2)
bar.update(i) This does roughly what you want I think :)
|
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Original discussion: #250
e.g. tqdm has it:
Other message:
I've actually had a similar question before and added a widget for it: #98
But...
I think you are looking for the AdaptiveTransferSpeed: https://progressbar-2.readthedocs.io/en/latest/progressbar.widgets.html#progressbar.widgets.AdaptiveTransferSpeed
Or the FileTransferSpeed: https://progressbar-2.readthedocs.io/en/latest/progressbar.widgets.html#progressbar.widgets.FileTransferSpeed
Instead of using B as the unit parameter, you want it in this case.
Note that by default it uses the si prefixes.
Oddly enough I remembering implementing this in a separate widget but I can't find it anymore... #98
https://stackoverflow.com/questions/30834730/how-to-print-iterations-per-second
tqdm/tqdm#1211
Beta Was this translation helpful? Give feedback.
All reactions