Created
December 24, 2019 00:30
-
-
Save p208p2002/e7f16f9bece4475b49878b5e3cd71707 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import progressbar | |
print('in range') | |
for i in progressbar.progressbar(range(20)): | |
time.sleep(0.02) | |
print('in list') | |
my_list = [1]*100 | |
with progressbar.ProgressBar(max_value=len(my_list)) as bar: | |
for i,l in enumerate(my_list): | |
time.sleep(0.1) | |
bar.update(i) | |
print('unknow len') | |
bar = progressbar.ProgressBar(max_value=progressbar.UnknownLength) | |
for i in range(20): | |
time.sleep(0.1) | |
bar.update(i) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment