[IPython-user] Embedded IPython and -pylab

Ville M. Vainio vivainio@gmail....
Sat Sep 13 04:09:06 CDT 2008


On Thu, Sep 11, 2008 at 11:01 AM, Inigo Aldazabal Mensa
<inigo_aldazabal@ehu.es> wrote:

>> See how you can do it with tests/test_embed.py
>>
>
> Sorry for the late replay.
>
> Thank you for the pointer. I missed it as I was looking at the examples and
> the manual, and they don't mention the subject. It's the most similar thing
> to what I wanted to achieve that I've yet found.

Yes, the manual is still missing lots of details and various
approaches of doing things. This is quite understandable, because the
number of approaches of solving things with ipython is only limited by
the python programming language itself ;-)

> Any idea on how could I inherit the whole previous namespace into the newly
> created IPython session? And regarding this, I understand that

Try doing ip.user_ns.update(globals()) in the embedding code.

> the "exported" variables get duplicated in memory, am I rigth? I say so
> because in some cases these could be quite big matrices, and I could run
> into memory and/or execution time problems.

No, they are not duplicated in the memory. It's how python object
model works in general - only the names are created that point to the
objects themselves.

-- 
Ville M. Vainio - vivainio.googlepages.com
blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio'


More information about the IPython-user mailing list