How to give jupyter cell standard input in python?

I came across the same problem, using the input in jupyternotebook, it blocks the execution and it does not work until restarting the program, so I added a print () after each input and my program is working.


Probably you hit Shift-Enter a second time without completing the first input with Enter, so the kernel was always waiting until the first command completed, before executing it again. If you use in the menu

"Kernel", "Interrupt",

all active commands are stopped (including the second execution of the box) and the problem should be solved without restarting the computer (or the browser / the kernel).


Use the raw_input() (for Python 2) or input() (for Python 3) methods.

Example code:

a = raw_input()
print(a)

Example notebook: