欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

IPython

程序员文章站 2022-03-21 11:02:49
...

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