Output widget loses some output
See original GitHub issueI’m using version 7.4.2
import ipywidgets as widgets
output = widgets.Output()
field = widgets.Text()
updating = False
def update(change):
global updating
with output:
if not updating:
updating = True
print('updating value')
field.value = 'a' + change.new
print('finished updating value')
updating = False
field.observe(update, names='value')
field.value = 'b'
After running this, the Output
widget only contains updating value
. The text finished updating value
is printed in the output area below the notebook cell.
To fix it, I can add an additional context
def update(change):
global updating
with output:
if not updating:
updating = True
print('updating value')
field.value = 'a' + change.new
with output:
print('finished updating value')
updating = False
Here, the Output
widget contains
updating value
finished updating value
as expected.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
clear output of output widget plotting a Seaborn figure does ...
I would like to display in the output widget a new figure every time, i.e. totally clear the content and then add stuff...
Read more >Output widgets: leveraging Jupyter's display system - ipywidgets
This always prints in the currently active cell, not the cell that started the background thread. This can lead to surprising behaviour in...
Read more >Command Output in a Widget - Forum - SolarWinds THWACK
Hi all,. I was wondering if there was a way I can put a certain command's output in a widget or somehow display...
Read more >Output Widgets - appJar
Output widgets are used for displaying information to a user. They usually provide three functions: ADD - this creates the widget; GET -...
Read more >Event handling in Rich UI - IBM
onFocusLost occurs when the widget loses the focus. The equivalent event in JavaScript is onBlur. onKeyDown, onKeyDown occurs when the user presses any...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hmm, this seems to work
This appears to be solved in #2384. Closing.