[IPython-dev] Nested and blocking calls of Interact or Interactive

Thomas Kluyver takowl at gmail.com
Fri Jun 19 14:07:14 EDT 2015


On 19 June 2015 at 10:20, Brian E Chapman <Brian.Chapman at utah.edu> wrote:

> First, is it possible to use interactive in a nested manner. That is, I
> have one function that I call with interactive and this function in turn
> calls another function with interactive?
>
>  Second, can you call interactive such that execution is blocked until
> the widget is closed? For example, I would like to call create/execute an
> interactive widget within a loop.
>

Widgets can't pause code, and the kernel won't process widget updates while
the kernel is running in the main thread. You could probably hack something
together using generators and/or threads to make it look like it was doing
that, but I wouldn't recommend it.

Can you describe at a higher level what you're trying to do - we might be
able to suggest other ways to achieve it.

Thomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20150619/d2b02edd/attachment.html>


More information about the IPython-dev mailing list