[IPython-dev] IPython <-> PuDB integration

Gökhan SEVER gokhansever at gmail.com
Fri Jul 10 10:40:16 EDT 2009


On Fri, Jul 10, 2009 at 9:27 AM, Andreas Klöckner
<lists at informa.tiker.net>wrote:

> On Donnerstag 09 Juli 2009, Andreas Klöckner wrote:
> > Hi all,
> >
> > I'm the author of PuDB [1], a full-screen, console-based visual debugger
> > for Python. I've recently (0.92.6) added support for using IPython as an
> > interactive shell, prompted by a user's request.
> >
> > [1] http://pypi.python.org/pypi/pudb
>
> Actually, I'm running into a problem here. This is what my IPy integration
> code looks like:
>
>    from IPython.Shell import IPShell
>    IPShell(user_ns=locals, user_global_ns=globals) \
>            .mainloop(banner=banner)
>
> Now unfortunately, it seems that IPython spews a good bunch of stuff into
> the
> dict I pass as "user_ns". Any way to avoid that?
>
> Andreas
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>
>
How do you drop into an IPy shell with the above commands?

I get bunch of error if I try them here:

>>> from IPython.Shell import IPShell
>>> IPShell(user_ns=locals, user_global_ns=globals).mainloop(banner=banner)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/gsever/Desktop/python-repo/ipython/IPython/Shell.py", line 73,
in __init__
    debug=debug,shell_class=shell_class)
  File "/home/gsever/Desktop/python-repo/ipython/IPython/ipmaker.py", line
100, in make_IPython
    embedded=embedded,**kw)
  File "/home/gsever/Desktop/python-repo/ipython/IPython/iplib.py", line
474, in __init__
    user_global_ns)
  File "/home/gsever/Desktop/python-repo/ipython/IPython/ipapi.py", line
654, in make_user_namespaces
    user_ns.setdefault('__name__','__main__')
AttributeError: 'builtin_function_or_method' object has no attribute
'setdefault'


Python 2.5.2 (r252:60911, Sep 30 2008, 15:41:38)
IPython 0.10.bzr.r1174 -- An enhanced Interactive Python.


-- 
Gökhan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20090710/2aaa726c/attachment.html>


More information about the IPython-dev mailing list