Share your repls and programming experiences

← Back to all posts
Debugging Python with birdseye
alexmojaki (7)

I'm the author of the open source Python debugger birdseye and I'd like to share how you can use birdseye to debug your repls and suggest that consider integrating birdseye into the site. I hope you can forgive the self promotion, I'm doing this because I genuinely believe that this could be very helpful, especially for beginners learning Python.

The repl I've shared shows debugging in action with just a few lines of code. First we run the code we want to debug, then we run the birdseye server and view the UI in the browser. If you'd rather avoid decorating a function, you can also import and trace an entire module in Python 3, see the docs for more.

I think birdseye can be integrated into the site to allow a much better experience than this without too much implementation effort. Imagine simply pressing a button similar to 'run' or 'debug' which runs the code and then immediately displays the UI with the traced code and values. This would be especially great in classroom assignments, as birdseye can be very useful for learning how Python breaks down and evaluates expressions.

This repl shows roughly how this could be implemented. Given the source code as a string, you can debug that code and get a URL where the UI can be viewed, perhaps embedded in an iframe. (If you follow the demo, go to the printed URL, and get an error, try running a fork of the repl and changing the domain of the suggested URL accordingly)

I'd love to hear from the team any questions, suggestions, or requests.