gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-04 03:54:26 24 4
gpt4 key购买 nike

我在 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com