[IPython-dev] Camera widget
doug.blank at gmail.com
Thu Feb 27 07:53:39 EST 2014
On Thu, Feb 27, 2014 at 12:39 AM, Jason Grout
<jason-sage at creativetrax.com>wrote:
> On 2/26/14 11:00 PM, Doug Blank wrote:
> > Here is a puzzle: can you make a kernel-side script that will take a
> > picture, *and* return it? It seems like you can't because the kernel
> > can't handle receiving the image while at the same time run your code
> > waiting for the message to come it. I guess you could do it with a
> > non-blocking kernel? Yep, just tried it by putting our kernel in
> > non-blocking mode.
> Can you elaborate on putting your kernel in non-blocking mode?
So in our kernel (ICalico), currently the only difference between blocking
and unblocking is whether the server waits for the thread running the
computation to finish (blocking) or not (non-blocking) before sending an
kernel idle message. In fact, I just exposed this setting, so the user can
control this. As a new user of IPython, I'm not sure how this maps onto the
IPython Python kernel's usage of blocking/non-blocking.
> I suppose what you bring up a is more general problem---I probably can't
> adjust a slider while some user code is executing and see the result in
> the code, for example.
That is what it looks like to me.
> On the other hand, if the comm infrastructure supported a blocking mode,
> where a message could be sent and then we block and wait for a reply, we
> could do your picture-taking example. Just ask the camera to take the
> picture, and then wait for the reply, just like asking for raw input and
> waiting for a reply.
That sounds generally useful! In that manner, we can *programmatically*
press the "Take Pic" button, wait for an variable update (or some message),
handle the message, and then return the results. I'm not sure exactly how
to implement it, but it sounds useful :)
> IPython-dev mailing list
> IPython-dev at scipy.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the IPython-dev