I'm iterating over a large group files inside a directory tree using the for loop.
While doing so, I want to monitor the progress through a progress bar in console. So, I decided to use tqdm for this purpose.
Currently, my code looks like this:
for dirPath, subdirList, fileList in tqdm(os.walk(target_dir)):
sleep(0.01)
dirName = dirPath.split(os.path.sep)[-1]
for fname in fileList:
*****
Output:
Scanning Directory....
43it [00:23, 11.24 it/s]
So, my problem is that it is not showing a progress bar. I want to know how to use it properly and get a better understanding of it working. Also, if there are any other alternatives to tqdm that can be used here.