I have some questions about spyder 3.2.4 ide for python:
The "sidebar" (to the right of the main code-window) which marks all lines with warnings, all lines with todo etc with a small colored marker. Can I set these colors? Can I disable which ones to show?
Can I "smart rename" a variable like in other IDEs? I mean not just text replace, but actually make sure i just rename the selected variable (all occurances and nothing but it) and not just text matching a string i type in like i would in "word".
Can I list all occurances of a variable like in other IDEs? Lets say I have a list called "combinedAreas" and want to list all the uses of that variable, preferably also being ablo to click a line and jump to that line.
Thanks!
(Spyder maintainer here) About your questions:
Can I set these colors?
No
Can I disable which ones to show?
Yes, you can do that by going to
Preferences > Editor > Code Introspection/Analysis > Analysis
Can I "smart rename" a variable like in other IDEs?
Not right now, but we're trying to implement this feature for Spyder 4 (our next major release).
Can I list all occurances of a variable like in other IDEs?
No, but it's also planned for Spyder 4.
Related
I would like to see all the code text on the left when I open PyCharm. I don't like that the code is all placed in the center. I would like to move it to the left. How can I?
There are no spaces before the code. It happens to all PyCharm files. The same files, if imported into another editor, have the code positioned on the left and there is no space.
Seems like the distraction free (view-)mode is active.
Try View > Appearance > Exit Distraction free mode.
This is what a plain Python file looks like in a fairly standard installation of PyCharm.
Note how there's no ruler over the editor, where yours appears to have one, and the gutter is coloured differently, while yours looks wide and has the same colour as the editor.
Your configuration is certainly not the default installation with a new default project. Perhaps you installed some sort of theme, or plugin that modifies the look?
This is a minor issue but I've been struggling with it most of the afternoon and getting nowhere, so here goes. I'm about to write a Python script that will require the use of the ScrolledListBox(). Never having used it before, I started with an experimental script where I could play with it and get familiar with it. I now have the script to where I can double click on an item and, in the handler, correctly print the selected item to stdout. However, I notice that when the item is selected, either with a single or double click, a rectangular border appears around the item in the list and remains there until another item is selected. I've been trying to see if there's a way to get rid of this border but so far have been unable to do so. Here's what I've tried:
1) Thanks to another post in this forum I found that the keys() method would give me a list of the available options for the widget. So, given a ScrolledListBox named slb1 I could do something like print(slb1.keys()) and I got the full list of everything I could configure on the widget. One of them was 'selectborderwidth' so I did: slb1.configure(selectborderwidth=0) thinking that this would remove the border. It didn't.
2) Next I dug through my copy of "Python and Tkinter" and discovered the selection_clear(first, last=None) method. The description states, "If any of the elements between first and last (inclusive) are selected, they are deselected." So I tried: slb1.selection_clear(0, None) in the handler but once again the rectangular border around the item remained.
I'm just getting started in Python and Tkinter so hopefully I'm missing something somebody with more experience knows about. Any ideas on how to get rid of the border?
Thanks,
Dave
The documentation by New Mexico Tech, which can be a good reference when working with Tkinter, lists the attributes for the Listbox widget, among which activestyle. This parameter refers to the box around the currently active (not necessarily selected) item, and can take the values underline, dotbox, and none.
If you set activestyle to none, the dotted border will go away.
I'm colorblind and I can barely make out the __init__ when it is on the current line where the caret is, as in this example:
I just can't see it against that highlighted "caret line" background. Same problem for __repr__, __str__, and other such predefined items.
So, I'd like to change their color. How do I do that?
I looked through the color settings (pic below), but I can't figure out which one to change. None of them seem to do what I want.
Yes, I know I could change the color of 'caret row', but that's not a viable alternative, because __init__'s current color also gives me problems in other circumstances.
In PyCharm you can go to File > Settings...
In the settings panel you can go to Editor > Colors and Fonts and select Python.
Now you are given a code sample where __init__ is probably part of. If you click on the __init__ element, PyCharm will redirect you to an element called "Predefined item definition" which you can set to another color (the "Foreground" element in the right panel):
This is a screenshot of Pycharm Community on Ubuntu. I hope this helps.
Your settings panel seems to have a hierarchical view, based on the panel on the right it is probably located under Identifiers > Predefined symbol.
Changing this will change all predefined elements (like __len__, __class__, etc.) but since you say it is because of color blindness, you want probably to change these as well anyway.
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!
PyCharm version: Community Edition 4.0.4
Is it possible to customize my color scheme for a python file in PyCharm such that certain statements are of darker color?
e.g. I want to make all statements starting with "logger" to be of gray color so that I can focus on my main code without having to wade through lot of info/debug statements.
I tried to find out if I can add new keyword in keywords1 keywords2 keywords3 keywords4 but can't find any such option. And on top of that, I can't find any way to alter colors for keyword1/2/3/4 individually.
I can't be the only one wanting to hide/dim logging statements!
There is no such feature in PyCharm 4.