IPython

作者: 小淼不卖萌 | 来源:发表于2018-09-05 00:11 被阅读0次

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

相关文章

网友评论

      本文标题:IPython

      本文链接:https://www.haomeiwen.com/subject/maupwftx.html