3 ms·
Python easily has the best debugger I've ever seen in a language. ``` import pdb; pdb.set_trace() ``` that's literally all you have to do at any point in your
by wmichelin 5y ago
Python easily has the best debugger I've ever seen in a language.
```
import pdb; pdb.set_trace()
```
that's literally all you have to do at any point in your code. Run your code in the foreground of a terminal, and boom you have a debugger exactly where you want it.
- gmfawcett 5y agoIn recent Python, it's even easier -- just put `breakpoint()` in your code.
- anarazel 5y agoFwiw, it's not too hard to approximate that in c/c++. Print out the pid (I often print out "gdb -p %d") and then sleep (and perhaps send SIGSTOP to other processes in more complicated scenarios).
- twobitshifter 5y agoPry with Ruby allows you to drop in to a repl anywhere with binding.pry You can edit the state and keep running after altering the program. But usually I just end up printing a few things from the repl and figuring out what is fouled up.