Skip to content

Commit ace28ff

Browse files
committed
update simpletest
1 parent 81be954 commit ace28ff

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

examples/progressbar_simpletest.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@
2727

2828
current_progress = 0.0
2929
while True:
30-
for current_progress in range(0, 21):
31-
print("Progress: {}%".format(current_progress * 0.05))
32-
progress_bar.progress = current_progress * 0.05
30+
# range end is exclusive so we need to use 1 bigger than max number that we want
31+
for current_progress in range(0, 101, 5):
32+
print("Progress: {}%".format(current_progress))
33+
progress_bar.progress = current_progress / 100 # convert to decimal
3334
time.sleep(0.02)
3435
time.sleep(0.3)
3536
progress_bar.progress = 0.0

0 commit comments

Comments
 (0)