Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: MinRK <benjaminrk <at> gmail.com>
Subject: Re: Running profile startup files in an embedded IPython instance
Newsgroups: gmane.comp.python.ipython.user
Date: Monday 23rd April 2012 19:57:10 UTC (over 4 years ago)
On Mon, Apr 23, 2012 at 12:34, Kevin Tran  wrote:

> > Yes, %store is not a builtin magic but an extension, just load it when
> > you start:
> >
> > %load_ext storemagic
>
> I having trouble understanding the difference between embedded shells and
> non-embedded shells.
>
> I believe that my ipython_config.py is run when the embedded shell
starts.
> In ipython_config.py I have `c.TerminalInteractiveShell.autocall = 1`.
The
> autocall setting is respected by both embedded and non-embedded shells.
> When I remove the autocall setting, autocall doesn't work in embedded nor
> non-embedded shells. This makes sense to me.
>
> Why is it that by default %store is loaded in non-embedded shells (at
> least it is for me) and not in embedded shells? Is it because
non-embedded
> shells have all the extension magic modules loaded and embedded shells do
> not?
>

This is simply because Extension config is attached to the Application,
rather than the Shell, which it shouldn't
be<https://github.com/ipython/ipython/issues/1144>.


The principal *functional* difference between an embedded shell and a
non-embedded one is that regular shells are children of Applications, and
embedded shells are not.  Things the Application does, then, are not
included in embedded shell setup.  This includes running startup files,
which makes sense, because embedded shells are initialized with a
particular namespace, and startup files are an alternative method for
initializing the namespace.

-MinRK



>
> Another strange thing about %store is that my stored values are not
> visible with %whos. %whos prints "Interactive namespace is empty." even
> though I have a macro that was stored and I can run the macro. A related
> thing is that after I load %store in an embedded shell, the macro is
> visible with %whos. Why is the macro not in the output of %whos in a
> non-embedded shell, but is there in an embedded shell? Or did I miss
> something else?
>
> Where is the list of extension magic modules?
>
> Thanks for the help.
> _______________________________________________
> IPython-User mailing list
> [email protected]
> http://mail.scipy.org/mailman/listinfo/ipython-user
>
 
CD: 3ms