Created
September 5, 2017 09:05
-
-
Save suganoo/2d046ac3271e40e5f24be77d144e2ebf to your computer and use it in GitHub Desktop.
プログレスバー使い方
This file contains 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
from time import sleep | |
from tqdm import tqdm | |
for i in tqdm(range(100)): | |
sleep(0.1) |
This file contains 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
from time import sleep | |
from tqdm import tqdm | |
pbar = tqdm(total=100) | |
for i in range(100): | |
pbar.update(1) | |
sleep(0.1) | |
pbar.close() |
This file contains 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
from time import sleep | |
from tqdm import tqdm | |
pbar = tqdm(["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"]) | |
for char in pbar: | |
pbar.update() | |
sleep(1) |
This file contains 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
from time import sleep | |
from tqdm import tqdm | |
pbar = tqdm(["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"]) | |
for char in pbar: | |
pbar.set_description("Processing %s" % char) | |
sleep(1) |
This file contains 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
from time import sleep | |
from tqdm import tqdm | |
pbar = tqdm(total=100) | |
# update x 10 times | |
pbar.update() | |
sleep(2) | |
pbar.update() | |
sleep(2) | |
pbar.update() | |
sleep(2) | |
pbar.update() | |
sleep(2) | |
pbar.update() | |
sleep(2) | |
pbar.update() | |
sleep(2) | |
pbar.update() | |
sleep(2) | |
pbar.update() | |
sleep(2) | |
pbar.update() | |
sleep(2) | |
pbar.update() | |
# end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment