Console window Appears when debugging Python code using PTVS in Visual Studio

I have enabled PTVS in Visual Studio to be able to support and debug intellisense. I set breakpoints in function definitions, but when I debug a control, it exits the function directly. And in some cases, the console window appears, and it never iterates the next line of code. I liked PTVS, but this thing got stuck. In Options-> Python Tools-> Interpreter Options, I set it as Python 2.7 Can anyone tell me what is wrong with the options and why the console screen appears.

Thanks in advance.

+3
python visual-studio-2010 visual-studio-2012 ptvs
source share
1 answer

When you say that you set a breakpoint in function definitions, do you mean on the line with "def ..." or do you set a breakpoint in the first expression of the function?

Python functions have executable statements, so if you put a breakpoint in the def line, then you are going to push the breakpoint when the function is defined and not executed.

As for the console window, it usually opens if you do not mark your application as a Windows application in the project properties (this will launch pythonw.exe, which does not include the console window).

If this does not help, you can send the code with which you are having problems, or a screenshot of the code with the breakpoints set.

+3
source share

All Articles