XRP Code Editor "prompt for number" ('raw_input') does not accept input?

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:

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?

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:

  1. RUN (uploads the program, but won’t accept keyboard input)
  2. STOP (stops the program)
  3. 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