[IPython-user] embedding in tk
Fernando Perez
Fernando.Perez at colorado.edu
Sun Mar 12 00:48:25 CST 2006
Hi Charlie,
Charlie Moad wrote:
> I was hoping someone could point me to the path of least
> resistance for embedding IPython into a Tkinter context. If there is
> a dead simple way to make it work naturally in IDLE that would be
> great. I can get IPShellEmbed to work in IDLE only if colors are
> disabled, but the key interactions don't seem to work at all (e.g.
> readline support). Is there sample code out there for a Tkinter.Text
> context? My google searches didn't get me very far so thanks in
> advanced.
I'm afraid I don't really know. I'm pretty sure readline will not work, since
you're not operating in a normal terminal.
This is why we are working on abstracting out all assumptions about a terminal
from ipython, so that it's easier to embed it into a GUI as a kernel that
takes calls for input/output/etc, but otherwise just returns strings which the
surrounding environment can display as needed. In that setup, the text widget
you choose would be the one responsible for displaying text and other
interactions with the user, simply feeding such information to the internal
ipython system.
But that's not done (by a long shot), so I'm afraid other than hacking your
way through, I don't know what to offer :(
Cheers,
f
More information about the IPython-user
mailing list