Ipython raw_input work around?

2019-07-21 05:08发布

问题:

I'm running a Python program that wants to accept raw_input which Ipython notebook does not do. (a known limitation)

What is a recommended way to achieve the functionality? (work around?) What I'd like to do is to be able to run the program, accept input and respond..(will be choices determined based on information retrieved), and also prompting for user id and password info..

Of course I'd like to do as little violence to the existing code as possible.

I found IPython.utils.io.raw_input_ext(prompt='', ps2='... ') in the Ipython docs but it calls raw_input and gets the same not implemented error

回答1:

Last developement version of IPython now support raw_input in notebook. (since beginning of may 2013 for future reader)