()
| 204 | |
| 205 | # -------------------- Demo Usage -------------------- |
| 206 | def demo_iterable_progress_bar(): |
| 207 | # start with a list of 100 integers as the user's list |
| 208 | my_list = list(range(1000)) |
| 209 | |
| 210 | # first form takes an iterable and a key and will return a value from your iterable |
| 211 | # and bump the progress meter at the same time |
| 212 | for value in progress_bar('bar1', my_list, title='First bar Test'): |
| 213 | # do something useful with value, a value from your list. |
| 214 | print(value) |
| 215 | |
| 216 | # Since the progress_bar is an iterator, you can use it within a list comprehension |
| 217 | my_list = [x for x in progress_bar('bar1', my_list, title='Second bar Test')] |
| 218 | |
| 219 | |
| 220 | demo_iterable_progress_bar() |
no test coverage detected