如何在IPython中显示函数参数? [英] How to show function parameters in IPython?

查看:1000
本文介绍了如何在IPython中显示函数参数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到在一个函数在IPython笔记本中显示函数的docstring后按 shift + tab ,但这似乎不适用于我的IPython(没有笔记本)。我在Ubuntu上运行IPython 4.0.0。

I read that pressing shift+tab after a function displays the function's docstring in an IPython notebook, but this does not seem to work in my IPython (no notebook). I run IPython 4.0.0 on Ubuntu.

有什么建议吗?

推荐答案

标准(控制台)IPython不支持通过< shift>的呼叫提示+< tab> 。但是函数之前或之后的问号会显示文档字符串:

The standard (console) IPython does not support the call tips via <shift> + <tab>. But a question mark before or after the function shows you the docstring:

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版本:

As an alternative you can use the qtconsole version:

ipython qtconsole

然后:

In [1]: list.index(

如果没有按< shift> +< tab>

这篇关于如何在IPython中显示函数参数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆