Reference:
[1]http://cs231n.github.io/ipython-tutorial/
IPython其实是一个比较方便的编辑器,当然可以用记事本来编写python程序,但是调试和运行何其麻烦,IPython其实就是一个比较方便的编辑器,同时可以编写python、cmd等指令执行。其实和matlab神似。
Python之前用IDLE逐行编辑和运行,或者整个文件进行执行,很难一段一段执行。matlab和python的共同特点都是解释执行的。相比于matlab就可以执行某一段这样的功能来说,IPython能够通过一段一段的编辑并一段一段的执行shift+enter
,和matlab的执行段
这样的操作很类似。除此之外,Ipython相比于matlab来说,matlab有临时变量区能够看到当前有什么变量和值,IPython在这一点上还是没有的。
install IPython:
pip install "ipython[notebook]"
会看到:
Collecting ipython[notebook]
Downloading ipython-5.0.0-py2.py3-none-any.whl (743kB)
100% |████████████████████████████████| 747kB 37kB/s
Requirement already satisfied (use --upgrade to upgrade): setuptools>=18.5 in c:\python35\lib\site-packages (from ipython[notebook])
Collecting prompt-toolkit<2.0.0,>=1.0.3 (from ipython[notebook])
Downloading prompt_toolkit-1.0.5-py3-none-any.whl (255kB)
100% |████████████████████████████████| 256kB 53kB/s
Collecting simplegeneric>0.8 (from ipython[notebook])
Downloading simplegeneric-0.8.1.zip
Collecting decorator (from ipython[notebook])
Downloading decorator-4.0.10-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): pickleshare in c:\python35\lib\site-packages (from ipython[notebook])
Collecting colorama; sys_platform == "win32" (from ipython[notebook])
Downloading colorama-0.3.7-py2.py3-none-any.whl
Collecting win-unicode-console>=0.5; sys_platform == "win32" (from ipython[notebook])
Downloading win_unicode_console-0.5.zip
Collecting traitlets>=4.2 (from ipython[notebook])
Downloading traitlets-4.2.2-py2.py3-none-any.whl (68kB)
100% |████████████████████████████████| 71kB 40kB/s
Collecting pygments (from ipython[notebook])
Downloading Pygments-2.1.3-py2.py3-none-any.whl (755kB)
100% |████████████████████████████████| 757kB 44kB/s
Collecting ipywidgets; extra == "notebook" (from ipython[notebook])
Downloading ipywidgets-5.2.2-py2.py3-none-any.whl (43kB)
100% |████████████████████████████████| 51kB 56kB/s
Collecting notebook; extra == "notebook" (from ipython[notebook])
Downloading notebook-4.2.2-py2.py3-none-any.whl (6.7MB)
100% |████████████████████████████████| 6.7MB 51kB/s
Collecting wcwidth (from prompt-toolkit<2.0.0,>=1.0.3->ipython[notebook])
Downloading wcwidth-0.1.7-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): six>=1.9.0 in c:\python35\lib\site-packages (from prompt-toolkit<2.0.0,>=1.0.3->ipython[notebook])
Collecting ipython-genutils (from traitlets>=4.2->ipython[notebook])
Downloading ipython_genutils-0.1.0-py2.py3-none-any.whl
Collecting ipykernel>=4.2.2 (from ipywidgets; extra == "notebook"->ipython[notebook])
Downloading ipykernel-4.4.1-py2.py3-none-any.whl (97kB)
100% |████████████████████████████████| 102kB 59kB/s
Collecting widgetsnbextension>=1.2.6 (from ipywidgets; extra == "notebook"->ipython[notebook])
Downloading widgetsnbextension-1.2.6-py2.py3-none-any.whl (1.5MB)
100% |████████████████████████████████| 1.5MB 54kB/s
Collecting nbconvert (from notebook; extra == "notebook"->ipython[notebook])
Downloading nbconvert-4.2.0-py2.py3-none-any.whl (319kB)
100% |████████████████████████████████| 327kB 24kB/s
Collecting jupyter-client (from notebook; extra == "notebook"->ipython[notebook])
Downloading jupyter_client-4.3.0-py2.py3-none-any.whl (76kB)
100% |████████████████████████████████| 81kB 36kB/s
Collecting jinja2 (from notebook; extra == "notebook"->ipython[notebook])
Downloading Jinja2-2.8-py2.py3-none-any.whl (263kB)
100% |████████████████████████████████| 266kB 35kB/s
Collecting jupyter-core (from notebook; extra == "notebook"->ipython[notebook])
Downloading jupyter_core-4.1.1-py2.py3-none-any.whl (76kB)
100% |████████████████████████████████| 81kB 46kB/s
Collecting tornado>=4 (from notebook; extra == "notebook"->ipython[notebook])
Downloading tornado-4.4.1-cp35-cp35m-win_amd64.whl (404kB)
100% |████████████████████████████████| 409kB 37kB/s
Collecting nbformat (from notebook; extra == "notebook"->ipython[notebook])
Downloading nbformat-4.1.0-py2.py3-none-any.whl (140kB)
100% |████████████████████████████████| 143kB 38kB/s
Collecting mistune!=0.6 (from nbconvert->notebook; extra == "notebook"->ipython[notebook])
Downloading mistune-0.7.3-py2.py3-none-any.whl
Collecting entrypoints (from nbconvert->notebook; extra == "notebook"->ipython[notebook])
Downloading entrypoints-0.2.2-py2.py3-none-any.whl
Collecting pyzmq>=13 (from jupyter-client->notebook; extra == "notebook"->ipython[notebook])
Downloading pyzmq-15.4.0-cp35-cp35m-win_amd64.whl (893kB)
100% |████████████████████████████████| 901kB 41kB/s
Requirement already satisfied (use --upgrade to upgrade): MarkupSafe in c:\python35\lib\site-packages (from jinja2->notebook; extra == "notebook"->ipython[notebook])
Collecting jsonschema!=2.5.0,>=2.0 (from nbformat->notebook; extra == "notebook"->ipython[notebook])
Downloading jsonschema-2.5.1-py2.py3-none-any.whl
Installing collected packages: wcwidth, prompt-toolkit, simplegeneric, decorator, colorama, win-unicode-console, ipython-genutils, traitlets, pygments, jupyter-core, pyzmq, jupyter-client, tornado, ipykernel, mistune, jinja2, entrypoints, jsonschema, nbformat, nbconvert, notebook, widgetsnbextension, ipywidgets, ipython
Running setup.py install for simplegeneric ... done
Running setup.py install for win-unicode-console ... done
Successfully installed colorama-0.3.7 decorator-4.0.10 entrypoints-0.2.2 ipykernel-4.4.1 ipython-5.0.0 ipython-genutils-0.1.0 ipywidgets-5.2.2 jinja2-2.8 jsonschema-2.5.1 jupyter-client-4.3.0 jupyter-core-4.1.1 mistune-0.7.3 nbconvert-4.2.0 nbformat-4.1.0 notebook-4.2.2 prompt-toolkit-1.0.5 pygments-2.1.3 pyzmq-15.4.0 simplegeneric-0.8.1 tornado-4.4.1 traitlets-4.2.2 wcwidth-0.1.7 widgetsnbextension-1.2.6 win-unicode-console-0.5
run IPython:
ipython notebook
jupyter notebook //recommend
于是浏览器就会打开http://localhost:8888/tree