表題のメモです。
JupyterのカーネルをMacのTerminalから実行する方法。
1 実験用Kernelの作成
こちらの記事を参考に実験用Kernelを作成。
http://qiita.com/Tsutomu-KKE@github/items/3c996bde01ef2637aadc
2 Kernelを立ち上げ
Terminalから実行
$ python3 keyvaluekernel.py
以下のメッセージが出るので、
NOTE: When using the `ipython kernel` entry point, Ctrl-C will not work.
To exit, you will have to explicitly quit this process, by either sending
"quit" from a client, or using Ctrl-\ in UNIX-like environments.
To read more about this, see https://github.com/ipython/ipython/issues/2049
To connect another client to this kernel, use:
--existing kernel-18639.json
同じフォルダに"kernel-18639.json"という空ファイルを作成
プログラムを中断し、再起動。
3 コンソール立ち上げ
別のTerminalを起動
Jupyterを起動
$ jupyter console --existing
正常に起動すれば、Kernelに接続して、入力可能なモードに移行。
/usr/local/lib/python3.5/site-packages/jupyter_console/ptshell.py:94: UserWarning: No lexer found for language 'keyvalue'. Treating as plain text.
warn("No lexer found for language %r. Treating as plain text." % name)
Jupyter console 5.1.0
Dictionry of Key, Value
In [1]: key1 value1
value1
In [2]: ?
key1
いじょです。