How to call for an input value from widget in Google colab?

815 Views Asked by At

I want to define a widget button (named start in this case) that when I press it, starts to ask for an input from the user. Here is the code I use:

from IPython.display import display
import ipywidgets as widgets

Start_button = widgets.Button(description="Start")
Start_output = widgets.Output()

display(Start_button, Start_output)

def Start_button_clicked(b):
with Start_output:
print("test Button clicked.")
test = input('input')

Start_button.on_click(Start_button_clicked)

But it gives me EOFError: EOF when reading a line

Any idea how to fix this?

0

There are 0 best solutions below