[IPython-dev] Simple Kernel Example

Doug Blank doug.blank at gmail.com
Fri Jan 17 09:36:35 EST 2014


Thanks to all for the pointers so far! I haven't gotten any of the
other languages to work yet (I've sent each responder a message
detailing what problems I am having. I'll report back here with status
on those fronts.)

I see that I should be able to:

$ ipython console
--KernelManager.kernel_cmd="['/path/to/simple_kernel.sh',
'{connection_file}']"

where simple_kernel.sh (with chmod +x) is just a simple echo (to see
if it is working).

But that gives:
...
  File "/usr/local/lib/python2.7/dist-packages/IPython/kernel/manager.py",
line 161, in _launch_kernel
    return launch_kernel(kernel_cmd, **kw)
  File "/usr/local/lib/python2.7/dist-packages/IPython/kernel/launcher.py",
line 251, in launch_kernel
    stdin=_stdin, stdout=_stdout, stderr=_stderr, cwd=cwd, env=os.environ)
  File "/usr/lib/python2.7/subprocess.py", line 709, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1326, in _execute_child
    raise child_exception
OSError: [Errno 8] Exec format error

I then tried to to create a profile:

$ ipython profile create simple_kernel

And edited ~/.config/ipython/profile_simple_kernel/ipython_config.py to include:
c = get_config()
c.Application.verbose_crash=True
c.InteractiveShellApp.code_to_run =
'/home/dblank/Desktop/IPython/simple_kernel.sh'

and run:

$ ipython console --profile simple_kernel

But nothing happens--just runs with no output. Any suggestions about
what is wrong, or how to proceed?

-Doug

On Thu, Jan 16, 2014 at 5:18 PM, Doug Blank <doug.blank at gmail.com> wrote:
> Hello devs,
>
> I've looked at the IPython docs, and IHaskell, IJulia, and IRuby backends,
> but having a bit of trouble seeing exactly what needs to be done to create a
> new kernel. I assume that a kernel could be an executable in any language
> that receives a filename whose contents are the configuration items (like
> port numbers). Then, I guess, it starts up threads to listen to those ports
> handling XMP data.
>
> If there were a simple HelloWorld-type kernel, that would be very helpful.
> For example, just a hello.py file that listened to the right ports, and
> returned an effective response of "Ok" (without doing anything) would be
> enough to get me started.
>
> Is there anything similar to that?
>
> Thanks for any help or pointers!
>
> -Doug
>
>
>
>
> --
> View this message in context: http://python.6.x6.nabble.com/Simple-Kernel-Example-tp5044217.html
> Sent from the IPython - Development mailing list archive at Nabble.com.
> _______________________________________________
> 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