How to show function parameters in IPython?

2019-04-24 02:15发布

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.

Any suggestion?

标签: ipython
2条回答
一纸荒年 Trace。
2楼-- · 2019-04-24 02:54

Press Tab+Shift, it works for jupyter notebook 5.6.0 version.

查看更多
ゆ 、 Hurt°
3楼-- · 2019-04-24 02:58

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  

As an alternative you can use the qtconsole version:

ipython qtconsole

Then:

In [1]: list.index(

Should show you a box with a call tip without pressing <shift> + <tab>:

enter image description here

查看更多
登录 后发表回答