[IPython-User] embedding ipython, namespace question

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[IPython-User] embedding ipython, namespace question

Darren Dale
Hello,

I'm working on embedding an ipython qtconsole in my applilcation as a dock widget. The https://github.com/ipython/ipython/blob/master/examples/Embedding/inprocess_qtconsole.py example was a helpful first step. As variables are created or updated in the main application, I'd like to be able to inspect them in the qtconsole. Is it possible for the qtconsole's namespace to be shared or linked with that of the main application? It seems like this should be possible, based on the documentation for http://ipython.org/ipython-doc/1/api/generated/IPython.terminal.embed.html#IPython.terminal.embed.InteractiveShellEmbed . I'm creating my kernel and client at the beginning of my module, and then wiring up the widget when my application's main window is about to show. But if I run `dir()` in the embedded ipython qt console, the list is identical to what I get if I run `dir()` in the standalone `ipython qtconsole` program.

Thanks,
Darren

_______________________________________________
IPython-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/ipython-user
Reply | Threaded
Open this post in threaded view
|

Re: embedding ipython, namespace question

Matthias Bussonnier
Hi Darren, 

IPython-user is sunsetting, so you will have more chance on [hidden email].

To try to answer you question, you will probably have to start in inprocess kernel yourself and
pass to it the user_ns on which it should work, that you can share with your app. 

Cheers, 

-- 
Matthias


Le 27 déc. 2014 à 17:07, Darren Dale <[hidden email]> a écrit :

Hello,

I'm working on embedding an ipython qtconsole in my applilcation as a dock widget. The https://github.com/ipython/ipython/blob/master/examples/Embedding/inprocess_qtconsole.py example was a helpful first step. As variables are created or updated in the main application, I'd like to be able to inspect them in the qtconsole. Is it possible for the qtconsole's namespace to be shared or linked with that of the main application? It seems like this should be possible, based on the documentation for http://ipython.org/ipython-doc/1/api/generated/IPython.terminal.embed.html#IPython.terminal.embed.InteractiveShellEmbed . I'm creating my kernel and client at the beginning of my module, and then wiring up the widget when my application's main window is about to show. But if I run `dir()` in the embedded ipython qt console, the list is identical to what I get if I run `dir()` in the standalone `ipython qtconsole` program.

Thanks,
Darren
_______________________________________________
IPython-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/ipython-user


_______________________________________________
IPython-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/ipython-user