In python I use the key to see the commands that an object has

0

For example with numpy, if I give it "numpy." after the . I want to see the command list that I have, before I did it with the tabulator key but it is not working anymore, or I do not remember correctly, I'm using the idle 3.6.0

    
asked by Daniel V 29.03.2017 в 19:03
source

2 answers

3

If you mean the code autocomplete, it works simply by waiting 2 seconds after . or using Ctrl + Espacio . You can change the waiting time and deactivate / activate the autocomplete in:

  

Options > Configure IDLE > Extensions

The problem with NumPy and other libraries that the IDLE itself does not use for its operation is that the autocomplete is not available because it is not present in namespace in which the name that is going to be completed is evaluated since the module it has not been imported in that IDLE session. This occurs in the code editor, not in the interactive shell or interpreter. If you're interested, you can look at this issue in the Python Bug tracker.

The solution is to open an interactive interpreter window ( Run> Python Shell )

and you import the same modules in it and in the same way you do in the editor.

Something simpler is that when you have all the written import execute the script by pressing F5 or "Run> Run Module" and then do not close the interactive interpreter window where it runs , if you do the autocomplete it will not work.

With that we get what I think you want:

    
answered by 29.03.2017 / 19:51
source
1

Look at the "Edit / Show Completions" menu, the shortcut is Control + Space.

link

    
answered by 29.03.2017 в 19:33