You may use gdb to debug your code.
gdb python
(gdb) run
which gives you the python shell within gdb
or
(gdb) run some_script
to run a script.
You may use ddd to run gdb and python in separate threads.
See page 381 in the fenics-book.
That said, debugging mixed language applications is harder than
single language applications.