PyQt4 installs an input hook (using
) that processes events
when an interactive interpreter is waiting for user input. This means that
you can, for example, create widgets from the Python shell prompt, interact
with them, and still being able to enter other Python commands.
For example, if you enter the following in the Python shell:
>>> from PyQt4 import QtGui >>> a = QtGui.QApplication() >>> w = QtGui.QWidget() >>> w.show() >>> w.hide() >>>
The widget would be displayed when
was entered amd hidden as soon
The installation of an input hook can cause problems for certain applications
(particularly those that implement a similar feature using different means).
module contains the
functions that remove and restore
the input hook respectively.