Tuesday, August 28, 2007

Embedding IPython on Your Python App

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!

2 comments:

Abraham said...

Hi! leosoto, i was reading your writings and i do not understand about what does it, but not by your bad english (ejjaja), but b'cause i do not understand on the topic :p. Nevertheless write in English it looks like to me a grand grand idea!!!.
continues forward..
may be that we see us later, or not. but I leave my regards you..

@braham.

(4°H) the same...

Leo Soto M. said...

Hi Abraham, good to know about you!

I know that python isn't precisely a popular topic, at least on the Chilean IT industry.

Perhaps my small rants about patterns are more familiar to you?

However, hope to see you soon.