[IPython-user] IPShellEmbed & listing interactive namespace?

Allen Fowler allen.fowler@yahoo....
Mon Jun 8 12:25:12 CDT 2009


Hello,

Thank you for the help.

A question:

What does this code work:

import IPython
shell = IPython.Shell.IPShell(user_ns=locals())
import app_modules
#And lot's of other setup
a = 5
shell.mainloop()

And this code does not:

import app_modules
#And lot's of other setup
# (Before creating shell)
import IPython
shell = IPython.Shell.IPShell(user_ns=locals())
a = 5
shell.mainloop()




________________________________
From: Gökhan SEVER <gokhansever@gmail.com>
To: Allen Fowler <allen.fowler@yahoo.com>
Cc: ipython-user@scipy.org
Sent: Friday, June 5, 2009 12:25:29 AM
Subject: Re: [IPython-user] IPShellEmbed & listing interactive namespace?

Hi,

Try these snippets and do a whos() in IPython:

import IPython
shell = IPython.Shell.IPShell(user_ns=locals())
a = 5
shell.mainloop()

Gökhan



On Thu, Jun 4, 2009 at 10:40 AM, Allen Fowler <allen.fowler@yahoo.com> wrote:


Hello,

I would like to use IPShellEmbed to let users tinker with the internal state of my application.

After dropping them to the shell, what is the best way to give the users a list of currently available objects/names/modules?

%who does not seem to be working as expected, and locals() is littered with ipython internal stuff.

Thank you,
Allen





_______________________________________________
IPython-user mailing list
IPython-user@scipy.org
http://mail.scipy.org/mailman/listinfo/ipython-user


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20090608/da7c9152/attachment.html 


More information about the IPython-user mailing list