468,316 Members | 1,505 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,316 developers. It's quick & easy.

restoring the default completer in IPython

This should probably go to the IPython list, but since I am not
subscribed I will try my luck here.
Basically, I want to embed IPython inside a command line interpreter
based on cmd.Cmd, in this
way:

import cmd, IPython

class Cmd(cmd.Cmd):
def do_ipython(self, arg):
ipython = IPython.Shell.IPShellEmbed()
ipython(global_ns=globals())
def do_EOF(self, arg):
return 1

Cmd().cmdloop()

It works, however when I exit from the IPython shell (after giving the
ipython command) the Cmd
class is still using the IPython readline completer, not the original
one. By looking at the source
code of IPShellEmbed I see that there is a
method .restore_system_completer() which is
called, but it seems to be not working. I am probably doing something
wrong, can somebody knowledgeable on IPython internals share some
light on that? TIA,

Michele Simionato

Aug 21 '07 #1
0 793

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Yaroslav Bulatov | last post: by
3 posts views Thread by Dave Merrill | last post: by
1 post views Thread by Jeremy Jones | last post: by
4 posts views Thread by Koray Bostancı | last post: by
1 post views Thread by Michael Tobis | last post: by
reply views Thread by James Stroud | last post: by
5 posts views Thread by Lou Pecora | last post: by
1 post views Thread by Karlo Lozovina | last post: by
8 posts views Thread by T. Crane | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.