def _update_hud(self): if self._maximum_delta > self.threshold and not self._timed_out: beep() # TODO: Requires patched version of pyface # See github:enthought/pyface pull request #35 # Don't beep more than once per second self._timed_out = True do_after(1000, self._switch_on_timeout) self.screen.hud('delta', 'Current average delta: {0._average_delta:.3f}\n' 'Current maximum delta: {0._maximum_delta:.3f}'.format(self))
# How to sound a beep with PyFace? from pyface.api import beep beep()