Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

tqdm prints an empty bar after loop ends

Tags:

tqdm

tqdm prints an empty bar after loop ends. I tried implementing this solution, but with no success.

The problem does not exist if I remove the print statement (see code).

My code is:

for PhotoIdx in tqdm(range(Nphotos), position=0, leave=True):
    .... 
end
print("something")
return x

I attach a photo with what is outputted to the terminal (the third bar is from another python file).

enter image description here

like image 747
yonatan Avatar asked Oct 28 '25 01:10

yonatan


1 Answers

This appears to be a Pycharm issue, which can be fixed by editing the Run/Debug Configuration in Pycharm and checking the box that says "Emulate terminal in output console"

enter image description here

The standard output terminal appears to have trouble with properly outputting text applications that use certain terminal features, although I don't know the exact cause of this particular problem.

like image 114
Tim Seguine Avatar answered Oct 31 '25 13:10

Tim Seguine



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!