[IPython-dev] Implementing inline images in a kernel

Doug Blank doug.blank at gmail.com
Tue Jan 28 19:58:06 EST 2014


Devs,

In implementing a new kernel, I can appropriately turn returned values into
their rich representation messages. But I'm wrestling with the idea that
the kernel could somehow, in the middle of computing, send such rich
representations to be displayed.

I've seen bits of code that appear to examine strings to see if they begin
with certain signatures that could detect PNG or JPEG encodings. Is that
how it would work... you just send a 64-bit encoded string to the front
end, and it automatically detects it as a rich representation? Or is there
a general standard for marking strings automatically as rich
representations? Or must the kernel construct a message to get any rich
reps? I could make the kernel monitor for special strings (sent from lower
levels), intercept them, and then send the special rich message.

If this question is confusing, perhaps it is because my kernel interfaces
with many subsystems that can generate strings to the output, but hooking
up the lower-level to the rich message system would be hard. I suspect that
this is similar to making an external language, like R, generate images
inline. How does it do it?

Thanks for any pointers,

-Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140128/755f95bc/attachment.html>


More information about the IPython-dev mailing list