jupyter_ui_poll.run_ui_poll_loop

jupyter_ui_poll.run_ui_poll_loop(f, sleep=0.02, n=1)[source]

Repeatedly call f() until it returns something other than None while also responding to widget events.

This blocks execution of cells below in the notebook while still preserving interactivity of jupyter widgets.

Parameters
  • f (Callable[[], Optional[~T]]) – Function to periodically call (f() should not block for long)

  • sleep (float) – Amount of time to sleep in between polling (in seconds, 1/50 is the default)

  • n (int) – Number of events to process per iteration

Return type

~T

Returns

First non-None value returned from f()