[IPython-dev] IPython inputhook, higher rate?

Gustavo Goretkin gustavo.goretkin at gmail.com
Thu Sep 4 12:34:08 EDT 2014


---------- Forwarded message ----------
From: Gustavo Goretkin <gustavo.goretkin at gmail.com>
Date: Thu, Aug 28, 2014 at 1:25 PM
Subject: IPython inputhook, higher rate?
To: ipython-user at scipy.org


I'm using IPython.lib.inputhook to run steps in a simulation (Box2D and
pygame, which uses sdl). When I run this step in my own loop, I can get
many hundred of Hertz. When I use set_inputhook, I can only get 8 Hz. When
IPython is integrated with GUI backends (like any of the matplotlib
interactive backends), it's very responsive. Is there a setting I'm missing?

Thank you!
Gustavo



    def run_from_ipython():
>         try:
>             __IPYTHON__
>             return True
>         except NameError:
>             return False
>
>     if not run_from_ipython():
>         while domain.running:
>             domain.run_step()
>     else:
>         from IPython.lib import inputhook
>
>         def step():
>             domain.run_step()
>             return domain.running
>
>         inputhook.set_inputhook(step)
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140904/5e0e878a/attachment.html>


More information about the IPython-dev mailing list