1.ipython簡介:
IPython 是一個 python 的交互式 shell,比默認的python shell 好用得多,支持變量自動補全,自動縮進,支持 bash shell 命令,內置了許多很有用的功能和函數
2.安裝
pip install ipython
pip3 install ipython
想讓winodows 下支持pip3,請參考:
3.使用
執行ipython
C:\Users\wanlifeipeng>ipython Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:43:06) [MSC v.1600 32 bit (Intel Type "copyright", "credits" or "license" for more information. IPython 5.3.0 -- 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.
發現ipython調用的是python3.4解析器
由於windows中已經安裝了cygwin,執行which ipython,發現了解決方法:
C:\Users\wanlifeipeng>which ipython
/cygdrive/c/Python34/Scripts/ipython
4.解決方法:
將C:\Python34\Scripts目錄下的ipython重命名為ipython3
5.效果:
C:\Users\wanlifeipeng>ipython Python 2.7.10 (default, May 23 2015, 09:40:32) [MSC v.1500 32 bit (Int Type "copyright", "credits" or "license" for more information. IPython 5.3.0 -- 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.
C:\Users\wanlifeipeng>ipython3 Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:43:06) [MSC v.1600 32 bit (Intel Type "copyright", "credits" or "license" for more information. IPython 5.3.0 -- 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.
