Using an interactive text widget
Another interactive widget is a textbox. We using a text widget and gather changes as they occur in the box.
How to do it...
We can use this script:
def mytextfunction(x): print(x) return x interactive_text = interactive(mytextfunction, x="Hello World") interactive_text
It gives this display:
![](https://static.packt-cdn.com/products/9781788839440/graphics/37e4c73e-98ac-43e8-9f9f-79af985325ea.png)
How it works...
Unexpectedly, the value changes on every keystroke you enter in the textbox, causing the printed display to mirror your typing.