Debugging in Python

2016-03-30

Miss being able to inspect, debug and run expressions in between your code?

I’ve heard so much about iPython’s debugging functionality and it turns out there’s a way to make use of it without having to use iPython itself.

Meet ipdb.

With just a couple of simple steps:

import ipdb

print("before break")
ipdb.set_trace()
print("after break")

You’ll drop into a nice interactive shell for your debugging need.

Most syntaxes are similar to ruby-debug, so if you’re coming from ruby, you shouldn’t have any issue.

ipdb screenshot
I’m currently working on fyra.sh, a CLI-first static site deployment tool where you push your site and it’s served globally through a built-in CDN, without the overhead of heavy platforms.