Support for interactive mode to allow VisPy’s event loop to be run alongside a console terminal, without using threads. This code relies on inputhooks built-in to the Python interpreter, and supports IPython too. The underlying inputhook implementation is from IPython 3.x.
Note that IPython notebook integration is not supported, as the browser does not use Python’s PyOS_InputHook functionality.
vispy.app.inputhook.
VisPyInputHook
Bases: vispy.ext.ipy_inputhook.InputHookBase
vispy.ext.ipy_inputhook.InputHookBase
Implementation of an IPython 3.x InputHook for VisPy.
This is loaded by default when you call vispy.app.run() in a console-based interactive session, but you can also trigger it manually by importing this module then typing:
>>> %enable_gui vispy
enable
Activate event loop integration with this VisPy application.
The VisPy application that’s being used. If None, then the default application is retrieved.
Notes
This methods sets the PyOS_InputHook to this implementation, which allows Vispy to integrate with terminal-based applications running in interactive mode (Python or IPython).
PyOS_InputHook
set_interactive
Activate the IPython hook for VisPy. If the app is not specified, the default is used.