This Blockly code:
generates this Python code:
n = None
def text_prompt(msg):
try:
return raw_input(msg)
except NameError:
return input(msg)
n = text_prompt('Type a number: ')
print(n)
When I run this Blockly code or Python code, typing something in response to the does nothing. Need to click “Stop” to exit.
However, running this same Python code in the REPL (shell) works as expected.
I see this XRP Code Editor bug:
opened 06:57PM - 10 Aug 23 UTC
bug
When a program uses the input() function the shell does not allow the input.
…
It works if a program is not running and you just type the code into the REPL.
Are there any known workarounds?
Any plans to fix this soon?
(I’d like to use input() in my July summer camp.)
Thanks,
Wayne
@Fgrossman You able to help with this?
Advay
June 18, 2024, 4:47pm
3
We are planning to use XRPs for our own summer camp so we noticed the same issue. Try pressing ctrl+d: it resets the program and allows it to take input. I do not know why that is necessary, but it seems to work.
1 Like
Thanks, @Advay !
This sequence works for me:
RUN (uploads the program, but won’t accept keyboard input)
STOP (stops the program)
In the shell area of the window, type CTRL-D , which restarts the program and allows keyboard input
This will be fixed in the next version. We have not yet set a date for the release. We will post when we have a date or test site for that version.
1 Like