-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tqdm progress bar flashes when writing lots of text #280
Comments
Hello @iownall555, TLDR: yes it's normal, it's by design and we hope this scenario won't happen in practical cases. Long version: All that is to say that We could workaround this problem by implementing a pooling system: tqdm could memorize the messages and display them at once every few seconds (or any other reasonable timeframe, for example based on mininterval), but this design was avoided until now because we thought it was better to immediately display messages: important messages should be shown ASAP, tqdm should not decide when to show them, it should be the responsibility of the user. So yeah, maybe we could provide an optional pooling system, but I'm not sure it will ever be useful. If you have so many messages to print at the same time as the progress bar, you probably ought to print them in a log anyway. |
That explains it perfectly. I'll try to keep message to a minimum as per your suggestion since using curses in my script (my use-case was for compiling lots of Lua files to bytecode) seems like overkill. Thanks for the explanation about this. |
You are welcome :)
|
It's very ambiguous. What is "many"? In what factor does my terminal starts to blink? what if I spend hours to add pooling system and it still blinks? For my case, I have dozens or pbars and 10 messages (write) per second. I don't consider this as "many" updates, though the pbar part is always flashing and unable to read the content. (I use this many pbars to track tasks per each threads) I understand this is a pickly issue, but still we deserve more documented and expected behavoiuour out of this library. Thank you : ) |
I've noticed when using tqdm that using tqdm.write() really quickly (such as in a loop) causes the bar itself to flash wildly.
As an example, consider the following code:
It prints the number correctly however the bar flashes to the point where it's near unreadable unless you add a delay. This is really annoying since I wish to print lots on information while running the bar.
Is this due to limitations in how tqdm draws the bar or some other issue?
EDIT: Almost forgot, I'm using Python3, tqdm 4.8.4 on Arch Linux, if that's important. The terminal I was using was xfce4-terminal with zsh
The text was updated successfully, but these errors were encountered: