python - 如何在 python 中的第二个提示符中导航

标签 python shell command-line

在 python shell 中,我定义了一个函数。现在我犯了一个错误,想跳4行来编辑这个语句: for i in range(N):

>>> def bisect(a,b,N):
...     for i in range(N):
...             num = f((a-b)/2.0)
...             if num == 0:
...                     print (a-b)/2.0
...             elif ()

如何在 shell 中上下导航以进行修改?

最佳答案

你不能。例如,使用另一个 Python shell,如 IPython。

IPython 的 Qt 控制台 (ipython qtconsole) 或 IPython Notebook 提供您想要的功能。您可以在编写代码时使用箭头键在代码中导航。

关于python - 如何在 python 中的第二个提示符中导航,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19622494/

相关文章:

python - on_mouse_down 调用每个按钮(甚至滚轮移动)

bash - 如何检查 Mac OSX 中可用的 shell?

linux - 使用脚本检查服务器配置

linux - 为什么这个 bash 脚本需要我按回车键才能继续?

c - 在C中解析空格分隔的文本

python - 如何从 Linux 终端逐行执行 python 命令?

python - 比较 PowerShell 和 Python 生成的 Windows PowerShell 中的两个 JSON 对象

python - 根据多个标识符查找值的中位数并添加到行

AWS Beanstalk 上的 Python。如何快照自定义日志?

linux - 如何从 linux 命令行运行 .exe 可执行文件?