ipython介绍
ipython是一个python交互式shell,比默认的python shell很多,支持变量自动补全,自动缩进,支持bash shell命令。ipython也是利用python进行科学计算和交互可视化的一个最佳平台。
Ipython提供两个组件:
1.强大的python交互式shell;
2.IPython notebook---供jupyter notebooks使用的一个jupyter内核;
ipython主要功能:
1.运行ipython控制台
2.使用ipython作为系统shell
3.使用历史输入(history)
4.Tab补全
5.使用%run命令运行脚本
6.使用%timeit命令快速测量时间
7.使用%pdb命令快速debug
8.使用pylab进行交互计算
9.使用IPython Notebook
ipython安装
pip install jupyter #包含ipython控制台,notebook;
ipython使用
?变量or方法,内省用法,显示其类别
%run命令运行脚本
使用%timeit命令快速测量代码运行时间

使用Pylab进行交互式计算


在IPython中使用系统shell,!作为shell的前缀;
使用IPython Notebook
ipython notebook #自动启动

新建python文件

输入内容及运行结果:

网友评论