[IPython-dev] IPython inputhook, higher rate?

Gustavo Goretkin gustavo.goretkin at gmail.com
Thu Sep 25 02:31:32 EDT 2014


I'm looking to investigate this but I'm confused about some important things

CPython calls the inputhook at 10Hz according to [1]. You can verify this
with [2], so my issue isn't related to SDL or pygame. It's just that the
callback gets called infrequently.

How then am I able to manipulate my matplotlib window and type more than 10
characters a second into the interpreter prompt? According to import
threading; threading.enumerate(), there are no threads aside from the
"_MainThread" and "HistorySavingThread", so I think some threads are being
setup and run from the gui libraries (like wx). I guess I do not understand
what is meant in [3].


[1] http://benno.id.au/blog/2006/09/02/pyton_rfte
[2] https://gist.github.com/goretkin/1973cb3735d03b04cc95
[3]
http://ipython.org/ipython-doc/rel-0.11/interactive/reference.html#gui-support

On Tue, Sep 9, 2014 at 1:07 PM, Fernando Perez <fperez.net at gmail.com> wrote:

> On Tue, Sep 9, 2014 at 10:03 AM, Erik Bray <erik.m.bray at gmail.com> wrote:
>
>> My guess is that an inputhook handler for SDL similar to the pyglet
>> inputhook might be necessary:
>>
>>
>> https://github.com/ipython/ipython/blob/825f3e480e9d9e4032abab7bc72e5cd086cc3e89/IPython/lib/inputhookpyglet.py
>>
>
> Yup, good guess.  I suspect the solution is along those lines too.
>
>
>> I don't have any more time too look into it right now though.
>>
>
> Sadly, most of us in the core team are in the same boat. If someone can
> put together a well-tested PR that solves the problem for them, we can
> probably merge it relatively quickly. These things are typically a small
> amount of code, but they require patience to get right and lots of live,
> interactive testing. We can't do that right now on this topic, but a clean
> PR where someone has done all that leg work would likely not be too hard to
> merge.
>
> Cheers,
>
> f
>
>
> --
> Fernando Perez (@fperez_org; http://fperez.org)
> fperez.net-at-gmail: mailing lists only (I ignore this when swamped!)
> fernando.perez-at-berkeley: contact me here for any direct mail
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140925/46824c27/attachment.html>


More information about the IPython-dev mailing list