Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
プログレスバー使い方
from time import sleep
from tqdm import tqdm
for i in tqdm(range(100)):
sleep(0.1)
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()
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)
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)
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
You can’t perform that action at this time.