Share this postData Science DailyHow to fix the tqdm progress bar which is broken with print statements #python #datascienceCopy linkFacebookEmailNotesMoreHow to fix the tqdm progress bar which is broken with print statements #python #datascienceData Science DailyMar 03, 2023Share this postData Science DailyHow to fix the tqdm progress bar which is broken with print statements #python #datascienceCopy linkFacebookEmailNotesMoreSharePhoto by IA SB on UnsplashI’m getting this output:import tqdm for alpha in tqdm.tqdm(np.linspace(0.01, 1, 20)): print(alpha, flush=True)because of the “print” statement.Here’s the proper way:for alpha in tqdm.tqdm(np.linspace(0.01, 1, 20)): tqdm.tqdm.write(str(alpha))Thanks for reading Data Science Daily! Subscribe for free to receive new posts and support my work.SubscribePreviousNext