python - Spyder 4:IPython 控制台中的向上/向下箭头(滚动程序输入)
问题描述
我在 2020 年 12 月升级到 Spyder 4.2.0。以前我使用 Spyder 3.x。我从 IPython 控制台中的编辑器运行我的代码。它们是提示控制台输入的简单程序。它类似于从命令行 ( python program.py args
) 运行。
当我进行测试时,我经常使用相同输入的不同组合(例如用户名)。使用 Spyder 3.x,我可以在运行程序时使用向上/向下箭头向后滚动以前的输入,以重用以前输入的值。我不知道如何使用 Spyder 4 获得相同的行为。下面的代码块中显示了一个示例。
runfile('E:/walker/optimization/test_prog.py', args='../large', wdir='E:/walker/optimization')
Loading data...Data loaded.
Input Name1: [I input the 1st name]
Input Name2: [I input the 2nd name]
Some printed output here...
Now the program prompts for new input...
Input Name1: [I want to reenter name2 above by going back with the up arrow]
Input Name2: [I want to reenter name1 above by going back with the up arrow]
我不知道如何用 Spyder 4.x 做到这一点。我怀疑从 Spyder 3 升级后发生了一些变化。我查看了IPython和Run in Tools/Preferences的设置。没有提到箭头或滚动输入。
注意:当我在控制台中编码并想要检索以前的 Python 命令时,在控制台中滚动可以正常工作。此问题特定于从编辑器运行代码时的程序输入。
解决方案
推荐阅读
- gradle - 如何在 gradle 任务中使用相对路径运行 ndk-build
- python - 如何撤消频道删除上的“get_something”
- php - 浏览 json 和计数值
- javascript - 使用 rxjs ReplaySubject 在两个组件之间共享数据的正确方法是什么?
- excel - excel日期格式MMYYYY
- oauth - 我收到了一封电子邮件,标题为:[需要采取行动] 使用受限 Gmail API 范围的项目的政策变更
- shell - 如果表计数为零或等于数字,是否存在退出配置单元的条件?
- c# - 如何使用 .NET AWS 开发工具包从 AWS S3 检索时过滤模式匹配文件?
- c++ - CMake - 使用 FetchContent 下载后如何构建 Boost?
- python - Flask 根据其他下拉菜单上的选择显示下拉菜单