Skip to Content

A stick figure smiling

Here's a preview from my zine, The Pocket Guide to Debugging! If you want to see more comics like this, sign up for my saturday comics newsletter or browse more comics!

Image of a comic. To read the full HTML alt text, click "read the transcript".

browse more comics! get the zine!
read the transcript!

In dynamic languages (like Python / Ruby / JS), you can use a debugger to jump into an interactive console (aka “REPL”) at any point in your code.

Here’s how to do it in Python 3:

  1. edit your code

my_var = call_some_function() breakpoint()
add “breakpoint()”!

  1. rerun your code (refresh the page, whatever)
  2. play around in the REPL! You can call any function you want / try out fixes!

How to do it in other languages: - Ruby:
binding.pry - Python (before 3.7):
import pdb; pdb.set_trace() - Javascript:

Saturday Morning Comics!

Want another comic like this in your email every Saturday? Sign up here!

I'll send you one of my favourite comics from my archives every Saturday.
© Julia Evans 2024 | All rights reserved (see the FAQ for notes about licensing)