# XRP Code Editor "prompt for number" ('raw\_input') does not accept input?

**URL:** <https://xrp.discourse.group/t/xrp-code-editor-prompt-for-number-raw-input-does-not-accept-input/393>\
**Category:** Blockly programming\
**Created:** [June 17, 2024, 5:14pm UTC](https://xrp.discourse.group/t/xrp-code-editor-prompt-for-number-raw-input-does-not-accept-input/393 "2024-06-17T17:14:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![WayneSeltzer](https://yyz1.discourse-cdn.com/flex011/user_avatar/xrp.discourse.group/wayneseltzer/32/159_2.png) [@WayneSeltzer](https://xrp.discourse.group/u/WayneSeltzer)\
**Post date:** [June 17, 2024, 5:14pm UTC](https://xrp.discourse.group/t/xrp-code-editor-prompt-for-number-raw-input-does-not-accept-input/393/1 "2024-06-17T17:14:00Z")

</div>

This Blockly code:

 ![text_prompt_blockly](https://canada1.discourse-cdn.com/flex011/uploads/xrp/original/1X/48e0d8b0c3914afd9fddbad4e692d245bdb802f6.png)  
generates this Python code:

```auto
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:

> <https://github.com/Open-STEM/XRPCode/issues/61>
>
> 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

---

<div class="post-metadata">

**Author:** ![SparkFro](https://yyz1.discourse-cdn.com/flex011/user_avatar/xrp.discourse.group/sparkfro/32/12_2.png) [@SparkFro](https://xrp.discourse.group/u/SparkFro)\
**Post date:** [June 17, 2024, 9:24pm UTC](https://xrp.discourse.group/t/xrp-code-editor-prompt-for-number-raw-input-does-not-accept-input/393/2 "2024-06-17T21:24:44Z")

</div>

@Fgrossman You able to help with this?

---

<div class="post-metadata">

**Author:** ![Advay](https://avatars.discourse-cdn.com/v4/letter/a/71c47a/32.png) [@Advay](https://xrp.discourse.group/u/Advay)\
**Post date:** [June 18, 2024, 4:47pm UTC](https://xrp.discourse.group/t/xrp-code-editor-prompt-for-number-raw-input-does-not-accept-input/393/3 "2024-06-18T16:47:21Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![WayneSeltzer](https://yyz1.discourse-cdn.com/flex011/user_avatar/xrp.discourse.group/wayneseltzer/32/159_2.png) [@WayneSeltzer](https://xrp.discourse.group/u/WayneSeltzer)\
**Post date:** [June 18, 2024, 10:31pm UTC](https://xrp.discourse.group/t/xrp-code-editor-prompt-for-number-raw-input-does-not-accept-input/393/4 "2024-06-18T22:31:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Fgrossman](https://avatars.discourse-cdn.com/v4/letter/f/b77776/32.png) [@Fgrossman](https://xrp.discourse.group/u/Fgrossman)\
**Post date:** [June 21, 2024, 4:28pm UTC](https://xrp.discourse.group/t/xrp-code-editor-prompt-for-number-raw-input-does-not-accept-input/393/5 "2024-06-21T16:28:28Z")

</div>

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.
