The Visual Python Debugger for Jupyter Notebooks You’ve Always Wanted

Introducing PixieDebugger

David Taieb
Mar 9, 2018 · 6 min read
A short YouTube demo of PixieDebugger in action

Introducing PixieDebugger

As advertised, the PixieDebugger is a visual Python debugger built as a PixieApp, and includes a source editor, local variable inspector, console output, the ability to evaluate Python expressions in the current context, breakpoints management, and a toolbar for controlling code execution.

PixieDebugger in action
  • The source editor shows the current code and highlights the current line being executed. The gutter on the left shows the line numbers and an icon for each line that has a breakpoint installed.
  • The variables panel on the right automatically shows the local variables for the current context.
  • The console tab shows any output from the current program or the PixieDebugger.
  • The Evaluate tab allows you to enter any Python expression and run it to get its value.
Evaluate pane of the PixieDebugger
Setting breakpoints
PixieDebugger “run to line” feature
Setting breakpoints in the PixieDebugger
Post-Mortem debugging after an exception occurred

Using the PixieDebugger to debug PixieApp routes

Where it becomes even more interesting is that the PixieDebugger also works to debug PixieApps. To illustrate how it works, let’s take an example of a simple PixieApp that has one button that calls a route called bad_route to populate a div element. In turn, the bad_route implementation calls bad_method, which triggers a ZeroDivisionError exception.

Debugging a PixieApp with PixieDebugger
PixieDebugger invoked to debug a PixieApp route
  • Debug Route: While post-mortem is only used to inspect local variables, you can use the debug route button to replay the route, stopping at the first executable statement.
Enhanced traceback for PixieApp with debugging facilities

Bugging out

The new PixieDebugger feature provides a long-awaited visual Python debugger to the Jupyter Notebook ecosystem, which takes data science notebooks one step closer to becoming a true IDE for both data scientists and developers.

IBM CODAIT

Things we made with data at IBM’s Center for Open Source Data and AI Technologies.

David Taieb

Written by

IBM CODAIT

Things we made with data at IBM’s Center for Open Source Data and AI Technologies.