IPython自体は Interactive な Paython として、shell内でQtなUI内でブラウザ内でスクリプト処理を実行してくれる。
http://ipython.org/notebook.html
Mathematicaっぽい使い方ができそうな。
ブラウザを利用するIPythonにおいては、notebookとして学生さんらの成果報告らをこれに報告させてしまえばいいのかと。
写真とかも貼れるようでPAGEの画像とか、あとプロトコルとかも載せれるかも。
pythonベースなので、RDKitらを噛まして構造式を表示させれるかも。
っで、あつまった各自の電子実験ノートを束にして、構造式検索とか、全文検索とか....
インストール †
ここを
http://ipython.org/ipython-doc/rel-0.13.1/install/install.html
読むと「IPython HTML notebook」には、IPythonとpyzmqとTornadoとMathJaxが必要なようだ。
っが、これらはCentOS6にてはどうやらyumでインストールできないみたい。pkgs.orgでもなかった。
なので、ソースから作る。
pyzmq
1
2
3
4
5
6
7
8
9
10
11
12
13
14
| [root@c ~]# yum -y install python-devel
[root@c ~]# wget http://download.zeromq.org/zeromq-3.2.3.tar.gz
[root@c ~]# gzip -cd zeromq-3.2.3.tar.gz | tar xf -
[root@c ~]# cd zeromq-3.2.3
[root@c zeromq-3.2.3]# ./configure; make; make check; make install
[root@c ~]# cd ..
[root@c ~]# wget https://pypi.python.org/packages/source/p/pyzmq/pyzmq-13.0.2.tar.gz --no-check-certificate
[root@c ~]# gzip -cd pyzmq-13.0.2.tar.gz | tar xf -
[root@c ~]# cd pyzmq-13.0.2
[root@c pyzmq-13.0.2]# python setup.py configure --help
[root@c pyzmq-13.0.2]# python setup.py configure --zmq=/usr/local/lib
[root@c pyzmq-13.0.2]# python setup.py build
[root@c pyzmq-13.0.2]# python setup.py install
|
Tornado
1
2
3
4
5
| [root@c ~]# wget https://pypi.python.org/packages/source/t/tornado/tornado-3.0.2.tar.gz --no-check-certificate
[root@c ~]# gzip -cd tornado-3.0.2.tar.gz | tar xf -
[root@c ~]# cd tornado-3.0.2
[root@c tornado-3.0.2]# python setup.py build
[root@c tornado-3.0.2]# python setup.py install
|
IPython
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
| [root@c ~]# yum -y install python-sphinx python-pygments python-nose pexpect
[root@c ~]# wget https://github.com/downloads/ipython/ipython/ipython-0.13.1.tar.gz
[root@c ~]# gzip -cd ipython-0.13.1.tar.gz | tar xf -
[root@c ~]# cd ipython-0.13.1
[root@c ipython-0.13.1]# python setup.py build
============================================================================
BUILDING IPYTHON
python: 2.6.6 (r266:84292, Feb 22 2013, 00:00:18) [GCC
4.4.7 20120313 (Red Hat 4.4.7-3)]
platform: linux2
OPTIONAL DEPENDENCIES
sphinx: 0.6.6
pygments: 1.1.1
nose: 0.10.4
pexpect: 2.3
pyzmq: 13.0.2
readline: yes
running build
running build_py
running build_scripts
|
となる
ちょいとテスト
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
| [root@c130 ~]# ipython
Python 2.6.6 (r266:84292, Feb 22 2013, 00:00:18)
Type "copyright", "credits" or "license" for more information.
IPython 0.13.1 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]: import math
In [2]: x = 1
In [3]: !echo {x+2}
3
In [4]: quit
[root@c ~]#
|
っで、ブラウザで使わせるための対処
1
2
3
4
5
6
7
8
9
10
| [root@c ~]# ipython profile create nbserver
[ProfileCreate] Generating default config file: u'/root/.config/ipython/profile_nbserver/ipython_config.py'
[ProfileCreate] Generating default config file: u'/root/.config/ipython/profile_nbserver/ipython_notebook_config.py'
[root@c ~]# vi /root/.config/ipython/profile_nbserver/ipython_notebook_config.py
c.NotebookApp.ip = '*'
[root@c ~]# mkdir /opt/notebook
[root@c ~]# cd /opt/notebook
[root@c notebook]#
[root@c notebook]# ipython notebook --profile=nbserver
|
これで該当マシンにアクセスすると
