# Debugger for python mode

**URL:** <https://discourse.processing.org/t/debugger-for-python-mode/9426>\
**Category:** Processing.py\
**Created:** [March 19, 2019, 12:50am UTC](https://discourse.processing.org/t/debugger-for-python-mode/9426 "2019-03-19T00:50:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hsamala](https://avatars.discourse-cdn.com/v4/letter/h/6a8cbe/32.png) [@hsamala](https://discourse.processing.org/u/hsamala)\
**Post date:** [March 19, 2019, 12:50am UTC](https://discourse.processing.org/t/debugger-for-python-mode/9426/1 "2019-03-19T00:50:11Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tabreturn](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/tabreturn/32/3697_2.png) [@tabreturn](https://discourse.processing.org/u/tabreturn)\
**Post date:** [March 20, 2019, 7:52am UTC](https://discourse.processing.org/t/debugger-for-python-mode/9426/2 "2019-03-20T07:52:02Z")

</div>

Perhaps [pdb](https://docs.python.org/2/library/pdb.html)? Python’s built-in debugger.

To test this out, download the [command line version of Processing.py](https://py.processing.org/tutorials/command-line/). 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.

```auto
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](https://docs.python.org/2/library/pdb.html) documentation for more info on what it can do.
