在Visual Studio工具中按Ctrl + F5组合键后,控制台窗口立即关闭 [英] Console windows closes right after I hit ctrl+F5 in visual studio tools for python

查看:351
本文介绍了在Visual Studio工具中按Ctrl + F5组合键后,控制台窗口立即关闭的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了适用于Visual Studio的Python工具,并且无法在控制台窗口中看到输出,就像在按下以下快捷键时在Visual Studio中运行C#控制台应用程序时看到的输出一样.

I have installed Python Tools for Visual Studio and I cannot see the output in the console window like I see output when I run a C# console application within visual studio upon hitting the following Shortcut keys.

F5-开始调试程序并在c#和Python中关闭控制台窗口.
Ctrl + F5-无需调试即可启动,可在C#中正常运行,但在Python程序中无法运行.它总是在两个选项下都退出控制台窗口.

F5 -- Starts debugging the program and closes the console window in c# and in Python
Ctrl+F5 -- Start without debugging, works as expected in C# but not in Python program. It always exits the console window under both the options.

对于Python应用程序,存在第三个选项"在Python Interactive中执行项目".此选项有时会产生输出,有时却不会.

There is a third option "Execute Project in Python Interactive" for a Python Application. This option sometimes produces output and sometimes does not.

我应该怎么做才能在控制台窗口中看到输出,并且在运行该程序后不应关闭这些窗口?对于python控制台应用程序,这甚至可能还是在概念上有所不同?

What should I do to see the output in the console window and the windows should not close after running the program? Is this even possible or some conceptual difference for python console apps?

我在这里做错什么了吗?

Am I doing something wrong here?

推荐答案

调试"部分下的工具"->选项"->"Python工具"->高级"中有一个选项,用于在进程异常退出时等待输入"和等待正常退出时输入".我以为默认情况下应该启用它们,但是启用它们应该使其等待.

There's an option in Tools->Options->Python Tools->Advanced under the Debugging section for "Wait for input when process exits abnormally" and "Wait for input when the process exits normally". I thought they were supposed to be on by default but enabling them should cause it to wait.

这篇关于在Visual Studio工具中按Ctrl + F5组合键后,控制台窗口立即关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆