如何在 python 解释器 shell 中重复最后一个命令?

2024-04-29

如何重复上一条命令?常用键:向上、Ctrl+向上、Alt-p 不起作用。他们创造出无意义的人物。

(ve)[kakarukeys@localhost ve]$ python
Python 2.6.6 (r266:84292, Nov 15 2010, 21:48:32) 
[GCC 4.4.4 20100630 (Red Hat 4.4.4-10)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> print "hello world"
hello world
>>> ^[[A
  File "<stdin>", line 1
    ^
SyntaxError: invalid syntax
>>> ^[[1;5A
  File "<stdin>", line 1
    [1;5A
    ^
SyntaxError: invalid syntax
>>> ^[p
  File "<stdin>", line 1
    p
    ^
SyntaxError: invalid syntax
>>> 

在 IDLE 中,转到“选项”->“配置 IDLE”->“密钥”,然后选择“history-next”和“history-previous”来更改密钥。

然后单击“获取新的选择键”,您就可以选择所需的任何组合键了。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如何在 python 解释器 shell 中重复最后一个命令? 的相关文章

随机推荐