f'{:.2f}' When you want to specify significant figures and display while using f'{}'
Use tqdm when you want to manage the progress. The basics about tqdm are nicely organized in other articles, so please refer to that. It is for people who want to get rid of "I'm surrounded by tqdm for the time being ...".
ind=3
txt = f'{ind:3d}.npy'
pbar = tqdm(lis)
for something in pbar:
pbar.set_description("Processing %s" % something)
Is the basic. I often use pathlib, so
from pathlib import Path
path = Path('hoge')
objects = path.glob('*/hoge')
pbar = tqdm(objects)
for object in pbar:
pbar.set_description("Processing %s" % object.name)
You can display the name of the file you are currently processing by doing something like.
Recommended Posts