Python----ipython

功能:

  • 支持自动补全, 交互式的数据可视化工具
  • 自动缩进
  • 支持bash shell 命令, 是基本 BSD 开源的
  • Jupyter 内核
  • 灵活、可嵌入的解释器
  • 内置了许多很有用的功能和函数
python abc.py


python3 abc.py
exit()      # 退出


ipython     
exit        # 退出

查看其支持的方法, 如:

C:\Windows\System32>ipython
Python 3.6.0b1 (default, Sep 12 2016, 18:11:36) [MSC v.1900 64 bit (AMD64)]
Type 'copyright', 'credits' or 'license' for more information
IPython 6.2.1 -- An enhanced Interactive Python. Type '?' for help.

In [1]: list = []
In [2]: list.
              append()  count()   insert()  reverse()
              clear()   extend()  pop()     sort()
              copy()    index()   remove()

In [3]: str = "s"
In [4]: str.
       capitalize()   format()       islower()      lower()        rpartition()   title()
       casefold()     format_map()   isnumeric()    lstrip()       rsplit()       translate()
       center()       index()        isprintable()  maketrans()    rstrip()       upper()
       count()        isalnum()      isspace()      partition()    split()        zfill()
       encode()       isalpha()      istitle()      replace()      splitlines()
       endswith()     isdecimal()    isupper()      rfind()        startswith()
       expandtabs()   isdigit()      join()         rindex()       strip()
       find()         isidentifier() ljust()        rjust()        swapcase()

魔术命令

命令               说明
%quickref        显示IPython的快速参考
%magic           显示所有魔术命令的详细文档
%debug           从最新的异常跟踪的底部进入交互式调试器
%hist            打印命令的输入(可选输出)历史
%pdb             在异常发生后自动进入调试器
%paste           执行剪贴板中的Python代码
%cpaste          打开一个特殊提示符以便手工粘贴待执行的Python代码
%reset           删除interactive命名空间中的全部变量/名称
%page OBJECT      通过分页器打印输出OBJECT
%run script.py    在IPython中执行一个Python脚本文件
%prun statement   通过cProfile执行statement,并打印分析器的输出结果
%time statement    报告statement的执行时间
%timeit statement   多次执行statement以计算系综平均执行时间。对那些执行时  间非常小的代码很有用
%who、%who_ls、%whos  显示interactive命名空间中定义的变量,信息级别/冗余度可变
%xdel variable       删除variable,并尝试清除其在IPython中的对象上的一切引用

win 下需要安装, 步骤:

  1. 需要先下载pip pip.9.0.1.tag.gz工具: https://pypi.python.org/pypi/pip#downloads
  2. 解压后命令行安装: python setup.py install
  3. 为方便操作一般要配置环境变量: C:\Users\Administrator\AppData\Local\Programs\Python\Python36\Scripts
  4. 测试: 在命令行输入: ipython

ubuntu 安装:

sudo apt-get install ipython 通过 ipython 启动。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值