IPython

ipython的安装类似于virtualenv,都是用python的第三方包

优点参考 https://www.cnblogs.com/zzhzhao/p/5295476.html

1. 自省

  • 变量、函数、关键字?或者??
In [1]: a = range(10)

In [2]: a
Out[2]: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

In [3]: a?
Type:        list
String form: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
Length:      10
Docstring:
list() -> new empty list
list(iterable) -> new list initialized from iterable's items

In [4]: list??
Init signature: list(self, /, *args, **kwargs)
Docstring:
list() -> new empty list
list(iterable) -> new list initialized from iterable's items
Type:           type

2. !ls 执行shell命令

In [2]: !ls
Applications            Parallels           linux_config
Applications (Parallels)    Pictures            nohup.out

3. 魔术命令

  • %quickref 列出ipython的手册
  • %timeit
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容