How to debug Python program (I come from Ruby on Rails / JavaScript background)?

I am building web applications using Ruby on Rails as my backend. I use React and Flux on an interface that is JavaScript. I can fully use the debugging tools that I need. I just add a line of code "debugger" anywhere in my application, so that execution stops. I am using beebug gem in Rails. When the line of code "debugger" is executed by the internal code, debugging occurs on the command line; when this happens in javascript, debugging happens in Chrome Dev Tools. In other words, I can work very quickly to debug.

What is an equivalent handy debugging tool in Python? In other words, what should a person do who can already program as a whole and just wants to quickly debug Python usage? I use the Atom editor (for example, I use when I create a web application).

+7
python debugging
source share
1 answer

You can use pdb

To add a breakpoint, insert:

 import pdb; pdb.set_trace() 

where do you want to stop.

+16
source share

All Articles