使用简单命令行在 VS 代码中调试 Python(例如:debug(function))
Debugging Python in VS code with simple command line (like: debug(function) )
我习惯在RStudio中调试。使用 RI,我只需使用命令:debug(my_function),然后是 运行 代码,脚本会自动在 my_function.
进行调试
现在我在 VS Code 中使用 Python,我发现可以通过使用红点直观地设置断点来进行调试。但是我需要调试一个函数而实际上并不知道这个函数在哪里声明。所以我的问题是我可以使用命令在 VS Code 中调试特定功能吗?
我希望使用类似这样的命令行 -> debug(my_function)
谢谢!
他们被称为Function Breakpoints
A function breakpoint is created by pressing the + button in the BREAKPOINTS section header and entering the function name. Function breakpoints are shown with a red triangle in the BREAKPOINTS section.
目前看来不可能,我已经在 GitHub 上提交了 feature request。
也许您可以尝试将函数复制到一个单独的 python 文件中,以便暂时调试它。
我习惯在RStudio中调试。使用 RI,我只需使用命令:debug(my_function),然后是 运行 代码,脚本会自动在 my_function.
进行调试现在我在 VS Code 中使用 Python,我发现可以通过使用红点直观地设置断点来进行调试。但是我需要调试一个函数而实际上并不知道这个函数在哪里声明。所以我的问题是我可以使用命令在 VS Code 中调试特定功能吗?
我希望使用类似这样的命令行 -> debug(my_function)
谢谢!
他们被称为Function Breakpoints
A function breakpoint is created by pressing the + button in the BREAKPOINTS section header and entering the function name. Function breakpoints are shown with a red triangle in the BREAKPOINTS section.
目前看来不可能,我已经在 GitHub 上提交了 feature request。
也许您可以尝试将函数复制到一个单独的 python 文件中,以便暂时调试它。