Bases: astropy.extern.six.Iterator
A class to display a progress bar in the terminal.
It is designed to be used either with the with statement:
with ProgressBar(len(items)) as bar:
for item in enumerate(items):
bar.update()
or as a generator:
for item in ProgressBar(items):
item.process()
Parameters: | total_or_items : int or sequence
ipython_widget : bool, optional
file : writable file-like object, optional
|
---|
Methods Summary
map(function, items[, multiprocess, file]) | Does a map operation while displaying a progress bar with percentage complete. |
update([value]) | Update progress bar via the console or notebook accordingly. |
Methods Documentation
Does a map operation while displaying a progress bar with percentage complete.
def work(i):
print(i)
ProgressBar.map(work, range(50))
Parameters: | function : function
items : sequence
multiprocess : bool, optional
file : writeable file-like object, optional
|
---|
Update progress bar via the console or notebook accordingly.