为什么我的代码结果显示在调试控制台上,通常它出现在终端上

问题描述

当我运行我的代码时,结果通常会显示在终端上,但这一次,它会显示在调试控制台上。我试图将 json 控制台更改为“internalConsole”。

代码

print('test')

控制台日志

D:\python folder>
D:\python folder>
D:\python folder>
D:\python folder>
D:\python folder>

调试控制台

the debug console

解决方法

  1. 当我们点击VS Code右上角的运行按钮时,代码会在“终端”中输出结果:

    enter image description here

  2. 当我们调试代码时(点击F5或点击“Start Debugging”按钮),配置文件“launch.json”中的“console”设置有三个不同的设置:

    1)。 "console": "integratedTerminal",(默认)(VS Code 的内部终端:)

    enter image description here

    2)。 "console": "internalConsole",(VS Code 的内部控制台:)

    enter image description here

    3)。 "console": "externalTerminal",(VS Code 的外部终端:)

    enter image description here

参考:console in VS Code