[英]How do I cycle to previous command in VSCode Python Terminal
In the integrated Power Shell terminal in VSCode in Windows 10, I can type a command, and then re-type it again at the prompt by pressing the up arrow key. 在Windows 10中VSCode的集成Power Shell终端中,我可以键入命令,然后按向上箭头键在提示符下再次键入它。
How do I get the same behavior in the integrated anaconda Python console? 如何在集成的Anaconda Python控制台中获得相同的行为?
This is a related question, though not applicable to the Python console. 这是一个相关的问题,尽管不适用于Python控制台。
Here are the steps to replicate the issue: 以下是复制问题的步骤:
.py
file in vscode 在vscode中打开.py
文件 ctrl + shift +F
运行文件ctrl + shift +F
python
在提示符下输入python
PS C:\\Users\\Fred\\Desktop\\pandas> python Python 3.6.5 |Anaconda, Inc.| PS C:\\ Users \\ Fred \\ Desktop \\ pandas> python Python 3.6.5 | Anaconda,Inc. | (default, Mar 29 2018, 13:32:41) [MSC v.1900 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. (默认值,2018年3月29日,13:32:41)[win32上的[MSC v.1900 64位(AMD64)]]键入“帮助”,“版权”,“信用”或“许可证”以获取更多信息。
>>> >>>
2+2
+ enter 在python提示符下输入2+2
+输入 up arrow
. 在python提示符下,输入up arrow
。 Nthing happens. 什么也没发生。 Expected to get last command 2+2
. 预计将获得最后一个命令2+2
。 Neither the Python extension or VS Code play any part in that. Python扩展或VS Code都不起作用。 Instead, it has to do with what Anaconda provides with their Python interpreters (ie they must not be including readline
). 相反,它与Anaconda提供的Python解释器有关(即,它们一定不能包含readline
)。
I would give ipython
a try and see if that does what you are after. 我会ipython
,看看是否能满足您的要求。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.