So, IPython rocks. But what if you want to use it deep inside a program to do a bit of exploratory programming with access to the full program state etc.? Just stick these two lines of code into the place you want to start off from:
I just discovered this, and it is unbelievably useful in some situations!
The code you want with modern IPython is:
import IPython; IPython.embed()