[IPython-User] embedding..

Matthew Brett matthew.brett@gmail....
Sat Aug 6 17:30:45 CDT 2011


Hi,

On Sat, Aug 6, 2011 at 2:53 PM, Julian Taylor
<jtaylor.debian@googlemail.com> wrote:
> On 08/06/2011 11:46 PM, Matthew Brett wrote:
>> Hi guys,
>>
>> Should I expect this to work?
>>
>> <embed_me.py>
>> def func():
>>     a = 3
>>     from IPython.Shell import IPShellEmbed
>>     ipshell = IPShellEmbed()
>>     ipshell()
>> </embed_me.py>
>>
>> python embed_me.py ?
>>
>> It just returns to the shell silently and looks at me like I'm an idiot.
>
> you never call func() in that file.
> if you do that it should work with ipython 0.10
>
> but with 0.11 you need to do this:
>
> import IPython
> IPython.embed()
>
> see here for more details porting to 0.11:
> http://wiki.ipython.org/Cookbook/Updating code that uses IPython for 0.11

Ah yes, sorry - that will be why it was looking at me like an idiot.

I got the instructions from the current docs:

http://ipython.scipy.org/doc/manual/html/interactive/reference.html#embedding-ipython

but I see at the top, the warning that I should have seen before.

Thanks,

Matthew


More information about the IPython-User mailing list