[IPython-user] How to use ipython's IPShellEmbed from within a running doctest
Wed Jan 6 01:25:42 CST 2010
Please help me get an embedded ipython console to run inside a doctest. The example code demonstrates the problem and will hang your terminal. On bash shell I type ctrl-Z and then kill %1 to break out and kill, since ctrl-C won't work.
# now try to drop into an ipython shell to help
# with development
import IPython.Shell; IPython.Shell.IPShellEmbed(argv=)()
if __name__ == '__main__':
print "Running doctest . . ."
I like to use ipython to help write code. A common trick is to use ipython as a breakpoint in my code by calling IPython.Shell.IPShellEmbed. This trick works everywhere I've tried (inside a django manage.py runserver, unit tests), but it doesn't work within doctests. I think it has to do with doctest controlling stdin/stdout.
Thanks in advance for your help.
More information about the IPython-user