Hacker News new | ask | show | jobs
by hwayne 1057 days ago
A couple people already pointed out that you can write `breakpoint()` instead of using `pdb.set_trace()`.

Here's one more trick: you can use `pdb` to run scripts! `python -m pdb foo.py` will run `foo.py` but trigger a breakpoint on the first error.

2 comments

That is definitely a neat one! If you are ok with it, I might add that one. I just updated the article already with some of the great comments and tips I recieved over here.
Oh! Thats a really nice one!