Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debugging python in Atom?

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

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

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

Any suggestions?

like image 237
masky007 Avatar asked Jan 08 '17 23:01

masky007


People also ask

Can you debug Python in Atom?

Debugging. To use a Python debugger in Atom, you will need to install the python-debugger package. Once installed, turn on the debugger by going to Packages -> python-debugger -> Toggle .

Does Atom have a debugger?

Atom Debugging UI PackageProvides a UI interface and basic functionality for building debugging inside Atom.

How do I debug my Python code?

Execute the statement (given as a string or a code object) under debugger control. The debugger prompt appears before any code is executed; you can set breakpoints and type continue , or you can step through the statement using step or next (all these commands are explained below).

Does Atom have a Python interpreter?

This is because Atom does not have a Python interpreter and cannot run Python scripts by itself. Next, we need to install packages to run Python on Atom. For this, open Atom. Then, click on the option “Install a Package” on the main page of the editor, and click on “Open Installer”.


2 Answers

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 pdb debugger 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.

like image 63
tdon Avatar answered Sep 23 '22 23:09

tdon


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

Edit 2020-09: since facebook abandoned the atom-ide project, atom-ide-debugger-python has been unmaintained.

like image 41
Steven Kalt Avatar answered Sep 21 '22 23:09

Steven Kalt