4

I tried for several hours to get solution to my basic question with out success. How can I get in Jupyter, multi-line input from user (Python3)? Pay attention that the question is regard to user input in Jupyter.

I have been try:

  1. widgets.Text:

    from IPython.display import display
    text = widgets.Text()
    display(text)
    button = widgets.Button(description="Send")
    display(button)
    
    def on_button_clicked(b):
        print(text.value)
    
    button.on_click(on_button_clicked)`
    
  2. Special keys:

    print ("Enter/Paste your content. Ctrl-D to save it.")
    contents = []
    line = "vv"
    while line != "":
        try:
            line = input("")
        except EOFError:
            break
        contents.append(line)
    

and more..

Thanks for you time and help, Oran

oransh
  • 73
  • 1
  • 6

0 Answers0