I am trying something like this:
#+BEGIN_SRC python :results output org drawer
import jupyter_client as client
find_connection_file = client.find_connection_file
cf = find_connection_file('test')
c = client.BlockingKernelClient(connection_file=cf)
c.load_connection_file()
c.start_channels()
msgid = c.execute('a=9')
print(msgid)
#+END_SRC
#+RESULTS:
:RESULTS:
df3b62be-dd12-4ebe-8f93-0a6045dc632d
:END:
It seems that the a=9 code was executed, but I can't figure out how to get
results back from the kernel. I expected I would get an execute_reply back,
but I got a msg id instead. Am I supposed to use that in another call to
get the reply or something?
On Monday, June 5, 2017 at 11:42:10 PM UTC-6, Matthias Bussonnier wrote:
>
> Hi John,
>
> The (best?) place to start is Jupyter Client docs [1], if you want to
> communicate with a pure kernel you'll have to use ZMQ – not much
> harder than HTTP[2], it's basically sockets on steroids –. and you
> want to manually use `python -m ipykernel <connection file>` to start
> a python kernel. The connection file give you infomations on how to
> bind/connect ZMQ ports. The "Making a kernel" part is the most
> complete (as that's what usually people are interested in), and we
> should improve the "making a client" part (maybe with your help ?).
> Regardless bug report welcome, and despite the jupyter_client
> implementation being in Python, any example in documentation in other
> languages welcome.
>
> Hope that helps get you started.
>
> Cheers
> --
> M
> [1] http://jupyter-client.readthedocs.io/en/latest/
> [2] the "Http" communication with kernels is actually websoket, and
> the `jupyter notebook`application is a websocket<->ZMQ bridge.
>
> On Mon, Jun 5, 2017 at 9:31 PM, John Kitchin <[email protected]
> <javascript:>> wrote:
> > Hi,
> >
> > I was wondering if there is a command to start an ipython kernel that
> you
> > can communicate with through http requests. I want to communicate with
> the
> > kernel through emacs to execute code blocks, inspect things, get
> completion
> > targets, and to interrupt the kernel. I haven't found any specific
> > documentation that suggests this exists though.
> >
> > I am familiar with the EIN project, but it does not seem to work for me.
> I
> > also know of the ob-ipython project. I currently use that, but it has
> its
> > own python driver to create a web server attached to a kernel. It does
> not
> > support completion or interruption though, and it isn't obvious how to
> > extend it.
> >
> > Thanks!
> >
> > --
> > You received this message because you are subscribed to the Google
> Groups
> > "Project Jupyter" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> an
> > email to [email protected] <javascript:>.
> > To post to this group, send email to [email protected]
> <javascript:>.
> > To view this discussion on the web visit
> >
> https://groups.google.com/d/msgid/jupyter/fc7035bb-e5f1-43cc-ae05-47ce64243907%40googlegroups.com.
>
>
> > For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jupyter/3de30365-b4f7-412c-bba7-f611741b1f2e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.