[IPython-dev] Can I open ipython from another python script with some objects shared (like code.InteractiveConsole) ?

Julian Taylor jtaylor.debian@googlemail....
Wed Sep 21 14:00:07 CDT 2011


On 09/21/2011 09:07 AM, rohit hiwale wrote:
> I have a qt application.
> I want to share my MainWindow object with ipython for debugging purpose.
> 
> Currently I am using code.InteractiveConsole which allows me to
> initialize the locals for the python console.
> /eg.    myconsole =
> code.InteractiveConsole(locals={'shared_object':MainWindow_object})/
> /        myconsole.interact()/
> Does ipython supports such interactive console ?
> If yes, how can I do same thing with ipython ?
> It will be even better if it can be done with ipython-qtconsole !!
> 
> PS : ipython-qtconsole is awesome !!

yes you can embed an terminal ipython console into your application.
See an example in docs/examples/core/example-embed.py
and this page for both 0.10 and 0.11 variants + a bunch of patches for
applications already doing it:
http://wiki.ipython.org/Cookbook/Updating_code_that_uses_IPython_for_0.11

Best Regards,
Julian Taylor

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
Url : http://mail.scipy.org/pipermail/ipython-dev/attachments/20110921/d22deea5/attachment.bin 


More information about the IPython-dev mailing list