【发布时间】:2015-12-21 10:11:19
【问题描述】:
我读到在一个函数在 IPython 笔记本中显示该函数的文档字符串后按 shift+tab,但这似乎不适用于我的 IPython(没有笔记本)。我在 Ubuntu 上运行 IPython 4.0.0。
有什么建议吗?
【问题讨论】:
-
在命令后面输入一个问号
标签: ipython
我读到在一个函数在 IPython 笔记本中显示该函数的文档字符串后按 shift+tab,但这似乎不适用于我的 IPython(没有笔记本)。我在 Ubuntu 上运行 IPython 4.0.0。
有什么建议吗?
【问题讨论】:
标签: ipython
标准(控制台)IPython 不支持通过<shift> + <tab> 调用提示。但是函数之前或之后的问号会显示文档字符串:
In [1]: list.index?
Docstring:
L.index(value, [start, [stop]]) -> integer -- return first index of value.
Raises ValueError if the value is not present.
Type: method_descriptor
您也可以使用 qtconsole 版本:
ipython qtconsole
然后:
In [1]: list.index(
应该在不按<shift> + <tab> 的情况下向您显示一个带有呼叫提示的框:
【讨论】:
pip install qtconsole PyQt5。此外,这似乎将在未来重命名为:jupyter qtconsole。
按Tab+Shift,适用于jupyter notebook 5.6.0版本。
【讨论】: