Console Window Appears while debugging Python code using PTVS in Visual Studio
Asked Answered
G

1

3

I have integrated PTVS into Visual studio so that i can have intellisense support and debugging capability. I set Breakpoints at Function definitions, but when i debug the control goes directly out of function. And in some points the Console window pops up and it never iterates to the next line of code. I liked PTVS but this thing has stuck me up. In options->Python tools-> Interpreter options i have set it as Python 2.7 Can Anyone tell me whats wrong with the options and why that console screen is appearing.

Thanks in advance.

Gaudreau answered 18/3, 2014 at 8:36 Comment(0)
S
3

When you say you're setting breakpoint at function definitions do you mean on the line with the "def ..." or are you setting the breakpoint on the 1st statement of the function?

In Python functions are executable statements so if you're putting the breakpoint on the def line then you're going to hit the breakpoint when the function is being defined rather than being executed.

As far as the console window it will generally open unless you mark your app as a Windows application in project properties (this will launch pythonw.exe which doesn't include a console window).

If that doesn't help you might want to post the code you're having trouble with or a screenshot of the code with where the breakpoints are set.

Sorry answered 18/3, 2014 at 17:30 Comment(3)
Thanks for your answer. I had set break points at the wrong part of code. And How Do you mark my app as a windows application in project properties? I tried searching but didn't get any option.Gaudreau
If you right click on your project and choose Properties in the "General" tab there's a "Windows Application" checkbox below Working Directory.Sorry
I have Checked it as a windows application in properties, now i dont get the Console window but the debugging process gets stopped at a point and doesnt move. Why is it so?Gaudreau

© 2022 - 2025 — McMap. All rights reserved.