StayFoolish
StayFoolish

Reputation: 521

How to make the spyder Ipython Console display function arguments tooltips automatically?

I am using the Spyder which comes inside the Anaconda3 IDE. I found the Ipython Console here is very helpful in the sense that when I type in a function, the arguments and default values will come up automatically. When I used to use Jupyter notebook, there is no such functionality.

What I mean is like this:

enter image description here

When you just typed the function name and a left bracket, the Arguments help window just pop up.

However, my problem is that, sometimes, in the middle of this function completion, in this example, I finished typing bottom=a, but I forgot what should be passed to width, so let's say I pressed Alt+Tab in windows system to check it out in a PDF. Then I press Alt+Tab to switch back to Ipython console, but now the Arguments help window just dispeared.

My question is is there any shortcuts to make the it appear again? Typically, I just have to clear all my arguments, and go back to type the left bracket another time to make it appear to help me specify the arguments, but this is unkind.

enter image description here

Upvotes: 3

Views: 5531

Answers (2)

Ferro
Ferro

Reputation: 2182

Press shift+tab to get the argument window back.
Press ctrl+space to get the function window which appears after a dot (e.g. after "plt.").

Upvotes: 3

J'e
J'e

Reputation: 3716

Use the object inspector (renamed to the help window in later versions of Spyder). It gives the information you're looking for and much more!

  1. In the main window, click on Tools -> Preferences -> Help -> Automatic connections -> check "IPython Console" and any others you'd like to use.

  2. Go to the help tab which is defaulted to the top right of the main Spyder gui.

  3. Click the gear on the top right of the help window and select "Rich Text"

  4. Set the "Source" to "Console" on the upper left side of the "Help" tab.

  5. In your IPython console, type plt.barh(.

Note the lock button next to the gear. This will lock the help window to the function while you continue to write code.

Object Inspector

Upvotes: 1

Related Questions