[IPython-dev] New hooks suggestion: line buf, cursor pos

Ville M. Vainio vivainio@gmail....
Sun Dec 7 14:57:06 CST 2008


On Sun, Dec 7, 2008 at 10:32 PM, Brian Granger <ellisonbg.net@gmail.com> wrote:

> Hmmm. I am not familiar with PyOS_InputHook, what does it do?

It runs the gui event loop when readline is reading input (i.e. python
is sitting at raw_input()). This has classically worked with Tk (one
of the reasons tk shell is single threaded). The same works with Qt
and new Gtk.


> It would be great to get rid of all the threading tricks for sure!  Do
> we have a prototype of using PyOS_InputHook?  By the name of this
> method, I am not sure it will handle all the cases we need.

- Tk ipython shell is already one example
- https://bugs.launchpad.net/ipython/+bug/270856

> Also, we need to make sure that IPython can run Twisted in a thread
> and all that integrates with what is done with the GUIs.  But, what
> does PyOS_InputHook do?

I think someone (Glenn Tarbox) used qt4reactor with ipython without
needing threads.

-- 
Ville M. Vainio
http://tinyurl.com/vainio


More information about the IPython-dev mailing list