如何在IPython中显示函数参数?

How to show function parameters in IPython?

我读到在函数后按 shift+tab 会在 IPython 笔记本中显示函数的文档字符串,但这在我的 IPython(没有笔记本)中似乎不起作用。我 运行 IPython 4.0.0 Ubuntu.

有什么建议吗?

标准(控制台)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> 的情况下向您显示一个带有呼叫提示的框:

Tab+Shift,jupyter notebook 5.6.0版本有效