I have this program in which a progress bar is displayed to show the process of computation of the pe ratio and other metrics for a set of stocks, however sometimes the progress bar stops at a given iteration and resumes whenever I press the enter key. Here is a short description of what my code does:
from tqdm import tqdm
nb_stocks = 100
with tqdm(total=nb_stocks, desc="Computing stock metrics: ", leave=True) as pbar:
for stock in stocks:
... # do stuff here
pbar.update(1)
I tried asking LLMs about potential solutions they could provide but none of them had any idea of what was wrong with my code.