I have made a search in PyCharm with classical Ctrl+Shift+F, and I just want to set a breakpoint at every line in result for debugging at once.
Does exists some functionality in the IDE to do this?
There's no such feature, unfortunately. Though you can place breakpoints manually in "Find in Path" preview window for a given search item.
Feel free to create a feature request in PyCharm's bug tracker https://youtrack.jetbrains.com/issues/PY
I'd like to get automatic context help in VS2017, similar to what is displayed inside spyder, when I click on an object that has help for it in the python manuals.
I's this possible?
interactive window example from spyder
I'm looking for a window that is part of the IDE, and not a pop-up that is shown when "." is pressed
You can hover your mouse over an object or method to see a tooltip of it.
You can also use the dot operator(.) to bring up intellisense for a list of properties and methods. If intellisense doesn't immediately pop up after pressing the . key, you can also press ctrl+space to force it open.
Lastly, you can press F12 with your cursor in an object, method or variable to go to its definition.
I just installed Anaconda and running Spyder I cannot find the Object Inspector. Hitting Ctrl+I has no effect and in the View/Panes menu there is no item Object Inspector.
I have seen videos and tutorials that show the Object Inspector. What is happening?
The "Object Inspector" is now called "Help" (from Spyder version 3.0 onwards); see https://groups.google.com/forum/#!topic/spyderlib/pF7KmSKDFXc . However, the Ctrl-I shortcut has not been changed, so I'm not sure what's happening with that.
go to preferences > Help and enable the Automatic connections for Editor and restart the Spyder
This worked for me!!
Although it's given in the tutorials but I'll explain.
1) Object Inspector is now known as Help.
2) I'm using Spyder 3.6, here go to Tools-->Preferences-->Help-->Check on Editor in Automatic Connections
3) Select your parameter and Ctrl+I
That'll do it.
I had the same problem. I found the help and then discovered that I got a message saying No Documentation. I tried changing the setting from Rich Text to Plain Text and for some reason that worked and I'm able to use the Object Inspector.
Since they changed "Object Inspector" to "Help", as Jitse Niesen says, they might have changed the shortcut too. In my Mac version the shortcut for "Help" is Shift+Cmd+H so the combination you are looking for is probably Ctrl+H.
On mac using Spyder 3.3.1 run from Anaconda.
Cmd + I was not working for me at first to show the object inspector on the right pane for help on a particular function. So I typed in Cmd + , (which is to access preferences panel in any app on Mac), and went down to "Help" on the left side.
Then, I checked the boxes for "Editor" and "IPython Console" under the description that says
"This pane can automatically show an object's help information after a left parenthesis is written next to it. Below you can decide to which plugin you want to connect it to turn on this feature."
After checking these boxes and pressing OK, Cmd + I still did not work for getting the object information.
I restarted Spyder, closing it and reopening it from Anaconda navigator.
Now Cmd + I works and shows the information for whatever function I click on.
Hope this helps someone. I'm still not quite sure what happened here (since those checkboxes were for the left parenthesis function), but I still thought that sharing the steps will be useful to some people.
In Windows, Ctrl+Shift+H worked after making changes to preferences as suggested by Ibrahem
Go to preferences->Help and tick the option of showing object info on Editor , then ctrl+I will work with any object
One way to go about this is to go to View > Panes > Online Help. Then in the search box insert the module or package like so (sklearn.preprocessing.Imputer) and you will have all the docs related to the package.(**Shortest way: click on package....then Cmd + i )
Alternatively, right clicking the Object in the editor, select Go to Definition
Third way, in your console, type help(your class here) like help(Imputer) or just help() to get the interactive console then type your package there (sklearn.preprocessing.Imputer`).
Hope this help someone.
After pressing Ctrl+H , a help window will come in that in [Source] dropdown select Console
Please check the spelling of your command, if you type wrong spelling it wont display the help
Note that in Spyder version 3.2.4 under Tools>Preferences>Help>Automatic Connections it clearly now states: "This pane can automatically show an object's help information after a left parenthesis is written next to it. Below you can decide to which plugin you want to connect it to turn on this feature." Then you can select Editor and/or IPython Console.
When I tried this, placing a left parenthesis before the (term is the only way I could get the help to bring up an example and a definition.
Nothing worked from above. I can debug objects easy in Visual Studio Code, but I can not do it in Spyder 3.2.8 installed with Anaconda 5.2 for Windows. In IPython console during debugging I use following.
To inspect an object:
vars(my_object)
To list class objects:
[obj.name for obj in gc.get_objects() if isinstance(obj, my_class)]
This solution solved the problem and shows objects in Variable Explorer.
https://gitter.im/spyder-ide/public?at=5b69bac8e9ab53770ca018d0
Question:
How can I explore objects during debugging like I explore variables?
In IPython consle I use vars(my_object), this is a prompt way. I want a GUI way for Object like Variable explorer.
I want a GUI way for Object like Variable explorer.
Answer:
As a matter of fact, Spyder has one, exactly like the Variable Explorer: it's called...the Variable Explorer! If you can't see them, make sure Exclude unsupported data types is not selected under the "Gear" menu in the top right of the pane.
Most arbitrary objects should work, although there may occasionally be a few bugs for more esoteric ones. Even better support will be coming in Spyder 4.
Just left click on the top right corner, beside the close tab of editor and below the working directory tab
I tried it, and it successfully worked.
Lets say I type the following in Spyder-IDE:
min(
Spyder will then automatically open the arguments list of the function min and give me:
Arguments
min(iterable[, key=func])
I find this very helpful but Spyder closes this list after 1.5sec. I would like to have this still open after 1.5sec. In fact it would be perfect if this list remained open while I type the arguments since it helps me to see what I need to specify for a correct function call. As far as I can remember, other IDEs such as Eclipse or QtCreator support this. Is this also possible with Spyder?
In the preferences section under Editor I found:
Highlight occurences after 1500ms
Changing this value has however no effect and it seems that this is not the value which I want to change.
If you're okay with having a "side" window, what you can do is go to Tools > Preferences > Object Inspector, and check off the Editor, Python Console, and IPython Console boxes, then click Apply/OK. Then navigate to View > Panes and click Object Inspector. It should pop up as another window next to your main text window. It's not exactly inline, but it will give you the same info (plus more).
I'm not sure if you have to check off all of "Editor, Python Console, and IPython Console", but it didn't work for me when I just selected Editor for some reason...
I'm on Spyder 2.7, btw.
HTH!
Every time I open a Python file PyCharm will hide all imports and shows:
import ...
within the editor.
I have to manually unfold it to see the imports. Where do I find the setting to undo auto-hiding of import statements?
As this question may be useful for people who also are not looking for the term "code folding", I'll make my comment an answer.
As extracted from IntelliJ IDE Web Help, but also worked on PyCharm CE 3.4.1:
Open the IDE Settings (File > Settings, or Ctrl+Alt+S).
Under the "Editor" node, click "General" and then "Code Folding". The "Code Folding" page is displayed.
In the "Collapse by default list", select the check boxes to the left of the code constructs you want to be displayed collapsed. So here you can uncheck "Imports".
Apply changes.
The image below shows what it looks like:
Actually in pycharm 2016.1 it's Editor -> General -> Code Folding