如何在IPython Notebook Server 3中看到函数参数?

问题:如何在IPython Notebook Server 3中看到函数参数?

我最近切换到了Anaconda版本的IPython Notebook 3(确切地说是3.1.0-cbccb68)。以前,当我键入一个函数并打开一个这样的括号时:

time.sleep()

如果光标在括号之间,那么我将获得一个显示功能参数的上下文覆盖菜单。现在,我没有看到它,尽管已经搜索了,但仍然找不到如何打开此功能的方法。

I’ve recently switched to IPython Notebook 3 (3.1.0-cbccb68 to be exact), the Anaconda version. Previously when I typed a function and opened a parenthesis like this:

time.sleep()

and if the cursor was between the parentheses then I would get a contextual overlay menu that displayed the function arguments. Now I don’t see it, and although I’ve searched, I can’t find out how I can turn on this functionality.


回答 0

在1.0中,该功能被绑定到(tabshift-tab,在2.0 tab被废弃,但仍具有功能在某些情况下,明确的完成或检查在许多情况下被竞争。建议始终使用shift-Tab(在类似Haskell的语法中,它也被添加为令人讨厌的不推荐使用,因为它在更多情况下也可以将人们推向Shift-Tab。在3.0中,已弃用的绑定已被删除,以支持正式发布,现在已存在18个月以上Shift-Tab

因此按Shift-Tab

In 1.0, the functionality was bound to ( and tab and shift-tab, in 2.0 tab was deprecated but still functional in some unambiguous cases completing or inspecting were competing in many cases. Recommendation was to always use shift-Tab. ( was also added as deprecated as confusing in Haskell-like syntax to also push people toward Shift-Tab as it works in more cases. in 3.0 the deprecated bindings have been remove in favor of the official, present for 18+ month now Shift-Tab.

So press Shift-Tab.


回答 1

尝试Shift-Tab-Tab使用比更大的文档Shift-Tab。一样,但是您可以向下滚动。

Shift-Tab-Tab-Tab 在您输入时,工具提示会持续10秒钟。

Shift-Tab-Tab-Tab-Tab 并且文档字符串出现在寻呼机中(窗口底部的一小部分)并停留在该位置。

Try Shift-Tab-Tab a bigger documentation appears, than with Shift-Tab. It’s the same but you can scroll down.

Shift-Tab-Tab-Tab and the tooltip will linger for 10 seconds while you type.

Shift-Tab-Tab-Tab-Tab and the docstring appears in the pager (small part at the bottom of the window) and stays there.


回答 2

为@Thomas G的答案添加屏幕截图(示例)和更多上下文。

如果它不起作用,请确保您已经正确执行了代码。在这种情况下,请确保import pandas as pd已正确运行,然后再检查以下快捷方式。

()使用快捷方式之前,请将光标放在括号的中间。

shift + tab

显示简短的文档和少量参数

shift + tab + tab

使用滚动条扩展文档

shift + tab + tab + tab

提供带有工具提示的文档:“您键入时会停留10秒钟”。这意味着您可以编写参数并等待10秒。

shift + tab + tab + tab + tab

它在底部打开一个带有选项的小窗口(小窗口的右上角),以在新的浏览器选项卡中打开完整的文档。

Adding screen shots(examples) and some more context for the answer of @Thomas G.

if its not working please make sure if you have executed code properly. In this case make sure import pandas as pd is ran properly before checking below shortcut.

Place the cursor in middle of parenthesis () before you use shortcut.

shift + tab

Display short document and few params

shift + tab + tab

Expands document with scroll bar

shift + tab + tab + tab

Provides document with a Tooltip: “will linger for 10secs while you type”. which means it allows you write params and waits for 10secs.

shift + tab + tab + tab + tab

It opens a small window in bottom with option(top righ corner of small window) to open full documentation in new browser tab.


回答 3

Shift-Tab可让我查看产品

Shift-Tab works for me to view the dcoumentation