<div class="gmail_quote">On Fri, Jul 10, 2009 at 9:27 AM, Andreas Klöckner <span dir="ltr"><<a href="mailto:lists@informa.tiker.net">lists@informa.tiker.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On Donnerstag 09 Juli 2009, Andreas Klöckner wrote:<br>
> Hi all,<br>
><br>
> I'm the author of PuDB [1], a full-screen, console-based visual debugger<br>
> for Python. I've recently (0.92.6) added support for using IPython as an<br>
> interactive shell, prompted by a user's request.<br>
><br>
> [1] <a href="http://pypi.python.org/pypi/pudb" target="_blank">http://pypi.python.org/pypi/pudb</a><br>
<br>
</div>Actually, I'm running into a problem here. This is what my IPy integration<br>
code looks like:<br>
<br>
    from IPython.Shell import IPShell<br>
    IPShell(user_ns=locals, user_global_ns=globals) \<br>
            .mainloop(banner=banner)<br>
<br>
Now unfortunately, it seems that IPython spews a good bunch of stuff into the<br>
dict I pass as "user_ns". Any way to avoid that?<br>
<font color="#888888"><br>
Andreas<br>
</font><br>_______________________________________________<br>
IPython-dev mailing list<br>
<a href="mailto:IPython-dev@scipy.org">IPython-dev@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/ipython-dev" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-dev</a><br>
<br></blockquote></div><br>How do you drop into an IPy shell with the above commands?<br><br>I get bunch of error if I try them here:<br><br>>>> from IPython.Shell import IPShell<br>>>> IPShell(user_ns=locals, user_global_ns=globals).mainloop(banner=banner)<br>
Traceback (most recent call last):<br>  File "<stdin>", line 1, in <module><br>  File "/home/gsever/Desktop/python-repo/ipython/IPython/Shell.py", line 73, in __init__<br>    debug=debug,shell_class=shell_class)<br>
  File "/home/gsever/Desktop/python-repo/ipython/IPython/ipmaker.py", line 100, in make_IPython<br>    embedded=embedded,**kw)<br>  File "/home/gsever/Desktop/python-repo/ipython/IPython/iplib.py", line 474, in __init__<br>
    user_global_ns)<br>  File "/home/gsever/Desktop/python-repo/ipython/IPython/ipapi.py", line 654, in make_user_namespaces<br>    user_ns.setdefault('__name__','__main__')<br>AttributeError: 'builtin_function_or_method' object has no attribute 'setdefault'<br>
<br><br>Python 2.5.2 (r252:60911, Sep 30 2008, 15:41:38) <br>IPython 0.10.bzr.r1174 -- An enhanced Interactive Python.<br><br clear="all"><br>-- <br>Gökhan<br>