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

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/30855169/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 09:04:45  来源:igfitidea点击:

How can I see function arguments in IPython Notebook Server 3?

pythonjupyter-notebookjupyter

提问by user11094

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:

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

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.

如果光标在括号之间,那么我会得到一个显示函数参数的上下文覆盖菜单。现在我没有看到它,虽然我已经搜索过,但我无法找到如何打开此功能。

采纳答案by Matt

In 1.0, the functionality was bound to (and taband shift-tab, in 2.0 tabwas 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.

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

So press Shift-Tab.

所以按Shift-Tab

回答by Thomas G.

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

尝试Shift-Tab-Tab一个更大的文档出现,而不是Shift-Tab. 它是一样的,但你可以向下滚动。

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

Shift-Tab-Tab-Tab并且在您键入时,工具提示会停留 10 秒钟。

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

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

回答by chandra sekhar

Shift-Tab works for me to view the dcoumentation

Shift-Tab 适用于我查看文档

回答by Shakeel

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

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

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

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

alt + tab

alt + tab

Display short document and few params

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

enter image description here

在此处输入图片说明

alt + tab + tab

alt + tab + tab

Expands document with scroll bar

用滚动条展开文档

enter image description here

在此处输入图片说明

alt + tab + tab + tab

alt + 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.

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

enter image description here

在此处输入图片说明

alt + tab + tab + tab + tab

alt + 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.

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

enter image description here

在此处输入图片说明