On Wed, Dec 14, 2011 at 5:59 PM, Dan Drake <dr...@kaist.edu> wrote: > That's interesting. I wonder if the kernel bit could be used in SageTeX, > where I have a bunch of Sage commands and want to get their outputs. > Perhaps this could make that process much simpler and more extensible.
Sure, in the end an ipython kernel is really nothing more than a Python 'exec' call waiting for you to send it things to run, and sending you answers back over the wire using zeromq. So if you load up that kernel with the necessary sage bits (prefiltering and the library imports), then you can send it blocks of sage code and it will send you back the answers. > Is there anything like this in the IPython docs? I looked around and > didn't find much. But I'll keep looking. I don't think we've taken the time to nicely document how to do this; the best 'explanation' may be to follow Paul Ivanov's vim integration: https://github.com/ivanov/vim-ipython This is included with ipython (we just re-merged it yesterday for updates) but is a good example of a 'non-traditional' client. In this case the client is not a normal console (be it terminal-, web- or qt-based ) but instead an instance of the Vim editor that sends code from the user to the kernel, and uses the kernel to do things like smart code completion (based on real introspection of live objects, not on static code analysis). That might be a good example to follow, don't hesitate to ask on the ipython-dev mailing list if something doesn't work or doesn't make sense. Best, f -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org