MCPcopy Index your code
hub / github.com/PySimpleGUI/PySimpleGUI / demo_iterable_progress_bar

Function demo_iterable_progress_bar

DemoPrograms/Demo_Progress_Meters.py:206–217  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

204
205# -------------------- Demo Usage --------------------
206def 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
220demo_iterable_progress_bar()

Callers 1

Calls 1

progress_barFunction · 0.85

Tested by

no test coverage detected