Can I stop execution of current module in ipython without leaving ipython

后端 未结 5 1579
遥遥无期
遥遥无期 2021-01-11 10:00

I\'d like to break out of the currently running program and be dropped back to the shell (without having to restart ipython)

相关标签:
5条回答
  • 2021-01-11 10:04

    Kind of a jenky method but I can often quit a process without exiting ipython by typing something like: ']='. It creates a syntax error, terminating the process and, thereby, returning you to the ipython shell.

    0 讨论(0)
  • 2021-01-11 10:12

    For the current version of IPython(Jupyter), you can simply click on Interrupt option under kernel tab.

    0 讨论(0)
  • 2021-01-11 10:18

    I had the same issue after reinstalling console2 and ipython on Windows. If you use the ipython.exe launcher, this seems to be a problem and it just closes the whole window. However, if you instead launch ipython with

    python C:\python27\scripts\ipython-script.py

    then it catches and handles the KeyboardInterrupt just fine and leaves me at the ipython prompt. Hooray.

    0 讨论(0)
  • 2021-01-11 10:20

    This answer may be a little too late, but for anyone who comes looking for an answer, you can use ESC

    0 讨论(0)
  • 2021-01-11 10:26

    Control-C works in the normal interactive Python shell, it should work in ipy also (except the program is catching the keyboardInterrupt exception)

    0 讨论(0)
提交回复
热议问题