From what I have read, there are two ways to debug code in Python:
With a traditional debugger such as pdb or ipdb. This supports c
pdb
ipdb
From python 3.2, you have the interact command, which gives you access to the full python/ipython command space.
interact