[IPython-dev] Assistance request in forming a correct kernel_info_reply

Matthias Bussonnier bussonniermatthias at gmail.com
Sun May 11 17:19:32 EDT 2014

Le 11 mai 2014 à 23:05, heathmatlock a écrit :

> https://github.com/heath/ijs/blob/master/kernel.coffee
> If you uncomment line 48 in the source file linked, it will be easier to see the response sent back by ipython. All the messages I'm receiving back are of type kernel_info_request, even though I'm sending back what I think is the appropriate response.
> Relevant portion of documentation:
> http://ipython.org/ipython-doc/dev/development/messaging.html#kernel-info
> Also, when developing a kernel for a non-Python consumer, do others use a development version of ipython and utilize pdb as well, or have you mostly been utilizing your language's debugging facilities, i.e.: receive a zmq response, inspect the response(in this case, I'm having to print the response to the screen, eek), ctl-c,  look at the documentation, build a response, repeat. 

I would suggest starting IPython with --debug flag to see messages going back and forth. 

Also the messages you send back and forth should not get only content. 
in the doc, you can get the all structure of messages here : 


and in the case of kernel_info_reply you should fill the content key with what you are doing above. 

Here is an full kernel_info_reply in my case :

{'parent_header': {'date': datetime.datetime(2014, 5, 11, 23, 13, 51, 792276), 'username': 'bussonniermatthias', 'session': 'd3b54a91-ba51-4b53-9393-4bec584075d7', 'msg_id': '1544cb4c-9190-4651-9caf-17330ea382cc', 'msg_type': 'kernel_info_request'}, 'msg_type': 'kernel_info_reply', 'msg_id': 'cd756a25-15ab-4996-87b5-460633f4ea68', 'content': {'protocol_version': [4, 1], 'language_version': [2, 7, 6], 'language': 'python', 'ipython_version': [3, 0, 0, 'dev']}, 'header': {'date': datetime.datetime(2014, 5, 11, 23, 14, 9, 461599), 'username': u'kernel', 'session': u'c32cf515-60af-421b-890a-4b6d82a77ecc', 'msg_id': 'cd756a25-15ab-4996-87b5-460633f4ea68', 'msg_type': 'kernel_info_reply'}, 'tracker': <zmq.sugar.tracker.MessageTracker object at 0x107b8b790>, 'metadata': {}}

A list of existing kernels and helpful resources


And an old toy js kernel. 



> -- 
> Heath Matlock
> +1 256 274 4225
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev

More information about the IPython-dev mailing list