[IPython-dev] Simple Kernel Example
Matthias BUSSONNIER
bussonniermatthias at gmail.com
Fri Jan 17 10:41:05 EST 2014
Hi Doug,
an old node kernel I wrote
http://nbviewer.ipython.org/gist/Carreau/4279371/node-kernel.ipynb
And responses to your question :
Le 17 janv. 2014 à 06:36, Doug Blank a écrit :
> 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
Did you added the #!/bin/sh ?
You can also try --KernelManager.kernel_cmd="['sh','/path/to/simple_kernel.sh', '{connection_file}']"
>
> 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'
I doubt that code_to_run what what you were looking for, here it should be `KernelManager.kernel_cmd` again.
--
M
>
> 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
>
More information about the IPython-dev
mailing list