23 Apr 2012 21:57
Re: Running profile startup files in an embedded IPython instance
MinRK <benjaminrk <at> gmail.com>
2012-04-23 19:57:10 GMT
2012-04-23 19:57:10 GMT
On Mon, Apr 23, 2012 at 12:34, Kevin Tran <hekevintran <at> gmail.com> wrote:
> Yes, %store is not a builtin magic but an extension, just load it whenI having trouble understanding the difference between embedded shells and non-embedded shells.
> you start:
> %load_ext storemagic
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.
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.
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
IPython-User <at> scipy.org
_______________________________________________ IPython-User mailing list IPython-User <at> scipy.org http://mail.scipy.org/mailman/listinfo/ipython-user