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

微笑、不失礼 提交于 2019-12-10 20:01:04

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/22474051/console-window-appears-while-debugging-python-code-using-ptvs-in-visual-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!