Leo's Technical Blog

Embedding IPython on Your Python App

Introduction

user

Leo Soto


python, debugging

Embedding IPython on Your Python App

Posted by Leo Soto on .
Featured

python, debugging

Embedding IPython on Your Python App

Posted by Leo Soto on .

Found in a comment of Python: Coding in the Debugger for Beginners, on Shannon -jj Behrens blog:

Jordan G said...

Since you mentioned IPython, I thought I'd drop this in here:

Its really easy to embed IPython into your programs and use them in a similar (but MUCH more powerful way) to the debugger.
Just put:
from IPython.Shell import IPShellEmbed
at the top of your program, and when you would break into the debugger, run:
shell=IPShellEmbed()
shell()

This allows you to poke at the state of your program with all the power of IPython!

Extremely useful!