Greg Aker

Entries Tagged with: VideoBlobbing

Debugging Python with pdb or ipdb

Filed in: Python, VideoBlobbing

April 5, 2012

Python has a wonderful debugger called pdb you should use if you aren't already. If you're like me and prefer to not use an IDE, you could have a mess of print statements as you try to debug things. If you don't know about it, you should be using pdb. It makes debugging a far nicer experience.

Here's a little script I came up with to remove odd numbers from a list.

import unittest

def remove_odd_numbers():
    my_list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
    for item in my_list:
        if item % 2 == 1:
           my_list ...

Read More