-
Notifications
You must be signed in to change notification settings - Fork 947
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
Output widget's clear_output not clearing when using append_stdout #2584
Comments
Hi, is there an update? Following code does not work:
Not working means the output is not cleared 🤓 |
As mentioned on stackoverflow, clear_output is using Jupyter's display mechanism, and is the same as:
append_stdout is not using the display mechanism, but the context manager is. I think there is room for improvement here, since now the Output widget is mixing two things (display mechanism and state syncing). I think we should be more consistent, use both, or one of them. We cannot avoid the display mechanism since that would not play nice with This means that a frontend:
|
Hi! I did have the same issue. But turned out that I could not even use the context manager, as I was trying to clear / update the Output from a thread, so that my notebook would still be available, and the output would update with data from rest calls. I worked around it by using a |
I'm wondering if @wonsjb's workaround works if I'm already using the workaround with |
workaround for this is posted on another thread: #3260 (comment) |
I stumbled upon a question on Stack Overflow where the first line printed in the output widget doesn't get cleared by the first call to
clear_output
.Replacing
append_stdout
with the context manager fixes the issue:but I am unsure of the reasons behind the erratic behaviour. I tried to look at the source of
append_stdout
but I haven't found it so far. Happy to submit a PR once I get to the bottom of this issue.The text was updated successfully, but these errors were encountered: