Debugger for python mode

This is a quick question but…

Is there a debugger for the Python mode in Processing?

I have a program with some bugs and it would be really helpful if there is one

Perhaps pdb? Python’s built-in debugger.

To test this out, download the command line version of Processing.py. The download page includes instructions for running it.

Then, import pdb into your working sketch. Below is some example code. The pdb.set_trace() acts as a breakpoint; you’ll need to enter an s in the terminal (for “step”) to advance a frame.

import pdb

x = 0

def setup():
    size(600,600)

def draw():
    global x
    rect(x,100,100,100)
    x += 5
    pdb.set_trace()

Checkout the pdb documentation for more info on what it can do.

2 Likes