繁体   English   中英

使 VSCode python 调试打印 output 到终端

[英]Make VSCode python debug print output to terminal

调试时,在print(..)时,vscode 不会将 output 打印到终端。 我尝试设置"console": "externalTerminal" ,但它不起作用,也没有"console": "IntegratedTerminal"
我弄清楚为什么会发生这种情况,因为 python 在遇到换行符之前不会打印 output 。 例如,

print("hello", end=" ") # will not output
print("world") # will output "hello world"

要在终端中查看打印输出,请确保您的面板首先显示('view' -> 'appearance' -> 'show panel')。

然后检查您是否正在查看面板的右侧部分。 VSC 有一个“调试控制台”和一个“终端”。 “调试控制台”是使用您的代码测试输入和输出的地方,但任何打印语句都将是 output 到您的终端。

截图在这里

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM