There is no real obstacle, but it isn't very convenient. The trouble is that the terminal frontend is truly synchronous, unlike a GUI frontend which is driven by an event loop. Here is how the terminal frontend executes code:<div>
<br></div><div><a href="https://github.com/ipython/ipython/blob/master/IPython/frontend/terminal/console/interactiveshell.py#L94">https://github.com/ipython/ipython/blob/master/IPython/frontend/terminal/console/interactiveshell.py#L94</a></div>
<div><br></div><div>You can see that 'handle_stdin_request' will never be called. To handle stdin, something must be special cased: the terminal frontend, the embedded kernel, or the embedded kernel manager. I'm not sure how to handle this cleanly. Perhaps the simplest thing is to add a switch to the kernel for calling 'raw_input' directly (bypassing the kernel manager). Only terminal frontends would use this switch. Perhaps others have better ideas.</div>
<div><br></div><div>Evan<br><br><div class="gmail_quote">On Thu, Sep 6, 2012 at 4:20 PM, Thomas Kluyver <span dir="ltr"><<a href="mailto:takowl@gmail.com" target="_blank">takowl@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Is there any major obstacle to implementing raw_input in the terminal<br>
frontend, or do you think it's just not worth it?<br>
<div class="HOEnZb"><div class="h5">_______________________________________________<br>
IPython-dev mailing list<br>
<a href="mailto:IPython-dev@scipy.org">IPython-dev@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/ipython-dev" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-dev</a><br>
</div></div></blockquote></div><br></div>