1

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?

Hanieh
  • 11
  • 1
  • Is it `python3` or `python2`? Does this conversation help you? https://stackoverflow.com/questions/954834/how-do-i-use-raw-input-in-python-3 – aminrd Apr 26 '22 at 00:30
  • It's `python3` so I believe `input()` command is safe to use – Hanieh Apr 26 '22 at 16:46

0 Answers0