在 Atom 中调试 python?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/41539235/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 01:13:05  来源:igfitidea点击:

Debugging python in Atom?

pythondebuggingatom-editor

提问by masky007

Any package or IDE for Atom that will allow me to watch variables when debugging?

任何允许我在调试时观察变量的 Atom 包或 IDE?

I tried https://github.com/webBoxio/atom-hashrocketbut this does not let me go step by step

我试过https://github.com/webBoxio/atom-hashrocket但这并没有让我一步一步

I tried https://atom.io/packages/python-debuggerBut it has no watched variables.

我试过https://atom.io/packages/python-debugger但它没有监视变量。

Any suggestions?

有什么建议?

回答by tdon

The best debugger I've been able to find for Atom is this: https://atom.io/packages/python-debugger, but it doesn't (from what I can tell) allow you to watch variables. You can step through code and type in the name of the variable you're trying to observe and the plugin will print the variable's value to the console. I think it's just a fancy UI for the pdbdebugger tool in Python. If you want an actual debugger for Python and you don't mind using a different text editor, you could try VSCode: https://code.visualstudio.com/and download the python debugger plugin, which lets you watch variables and set breakpoints much like Visual Studio or XCode, or you could try the community version of PyCharm: https://www.jetbrains.com/pycharm/which has a debugger built in.

我为 Atom 找到的最好的调试器是这样的:https: //atom.io/packages/python-debugger,但它(据我所知)不允许您查看变量。您可以单步执行代码并输入要观察的变量的名称,插件会将变量的值打印到控制台。我认为这只是pdbPython 中调试器工具的精美 UI 。如果你想要一个实际的 Python 调试器并且你不介意使用不同的文本编辑器,你可以尝试 VSCode:https://code.visualstudio.com/并下载 python 调试器插件,它可以让你观察变量并设置断点很像 Visual Studio 或 XCode,或者您可以尝试 PyCharm 的社区版本:https://www.jetbrains.com/pycharm/它有一个内置的调试器。

回答by Steven Kalt

Try atom-ide-debugger-python. It runs with atom's ide-pythonand allows variable watching as well as breakpoint setting.

尝试atom-ide-debugger-python。它与 atom 的ide-python一起运行,并允许变量观察以及断点设置。