PyCharm Code Folding Collapse - python

In PyCharm, I have it selected in my settings so that when I collapse the code within a method or I collapse my import statements, I get the box on the left hand size by the line numbers with the "+" inside it to expand when I want to investigate.
Is there any way to adjust the color settings in PyCharm regarding that expansion box with the "+" so that is stands out better? On my Mac it stands out just fine and I can always find them, but on my Windows machine (using a very similar if not the same Darcula color settings .jar) the boxes blend in too perfectly with the background of the script and I have trouble finding them. I am not sure if it is that the box is not outlined properly, or if the colors prevent me from seeing the outline at all.
Thanks!

I personally prefer to use the keyboard shortcuts for (un-)folding. They are very helpful and maybe you can have a look. I also sometimes click "in the code" to fold or unfold code.
If that does not solve your problem, intelliJ comes with 3 different default UI themes (Darcula, GTK+, IntelliJ on linux) that you can change in Settings > Appearance > Theme. Maybe you can switch to another theme.
If they're not what you need, you can also download custom theme plugins such as: https://plugins.jetbrains.com/plugin/8006?pr= . Perhaps "material black" which is close to "darkula" can render your buttons a bit more clearly.
Or, you can also define custom themes to change only the plus button (as it's an "appearance" setting, not syntax highlighting, you can't easily change the color or the shape of that specific button). It's more hard than the two previous solutions (as it involves creating a custom plugin), but you can pick one from github and just change the icon you need. https://github.com/ChrisRM/material-theme-jetbrains/tree/master/resources/icons could be a good starting point

Related

What happened to the Python interactive window?

I am working on MacOS v10.14.6 and using the Python interactive window of VScode v1.38.1.
I write code in a .py file and use #%% to create cells and shift+enter to run them in the interactive window.
Today the layout of the interactive window changed, but I didn't do any update and I did not change my settings.
It now shows icons on the top left (as on the screenshot below) instead of showing them on the top right, as it was the case before (as shown in the tutorial).
To me it looks like that doing shifts+enter now launchs a jupyter notebook similar to the one now supported by vscode, because the icons are similar. See the ones on this tutorial here.
The really annoying thing is that now my plots have a dark background, instead of a white one as it was the case before.
I checked and the option python.dataScience.ignoreVscodeTheme is still set on True.
Do you have an idea what happened ?
Thanks for the info Louis. So you are still seeing the interactive window there, not the new notebook experience, we just made some tweaks to the icons and icon locations to match the interactive window up better with the new experience. However while much of that is expected we did break the ignoreVscodeTheme setting. We have an issue filed on that there and it's on our immediate list to fix. Sorry about that, and thanks for reporting.
https://github.com/microsoft/vscode-python/issues/7847

Scroll python function help in Vim

I am learning to use vim as an IDE for Python and followed this tutorial to setup my .vimrc file. My setup is working fine.
Here, vim shows me the help for np.random.randint, but I could not figure out how to scroll through the displayed help and read about the other parameters. This feature is introduced by YouCompleMe (as far as I understand), so possible solution might be to change some configuration for it.
Since, I am new to this, I am not even sure what this feature is called (auto complete does not seem to be the right name for displaying help) and therefore was not able to find help on web-searching.
Any help will be appreciated, thanks.
YouCompleteMe uses the Jedi library for Python. If you want to install Jedi alongside YCM, this answer has some advice on how to do so.
In any case, the extra docstring information is opened in a preview window, so you should be able to switch to it in normal mode (ctrl-w w) and scroll like a regular Vim window.
If the buffer disappears when you exit insert mode, here's some sample solutions:
If you're okay with enabling mouse controls, add set mouse=a to your VIMRC, and then you can click between the buffers while typing and even scroll using your mouse wheel or trackpad.
Remove let g:ycm_autoclose_preview_window_after_completion=1 from your VIMRC, since that will remove the preview window when you enter normal mode. Then, switch to the window normally.
Change the default preview height. Just be aware that this might be annoying if you have limited screen space.

Python tkinter - windows larger display settings

My problem is when somebody runs my tkinter gui (in Windows 7) and has larger display settings (125%), the gui doesn't look well (buttons are closer to each other, end of text cannot be seen, etc.). I use place method with x - y coordinates to place the widgets.
Maybe using pack method could solve this, but it is easier to use place for me, because there are lots of labels and buttons with exact places.
Another solution can be if the display settings could be checked with pywin32 and resize everything if needed. If it is possible, please confirm and help, what is the related function or if you have any other idea/advice, please share it.
This is one of the reasons why place is a poor choice. You should switch to using grid and/or pack. They are specifically designed to handle different screen sizes, different resolutions, different widget styles, and different fonts.

Create a little python applet in a linux task bar

I would like to create for my linux task bar a little applet in python, which simply display an icon that could change of color, and when we click on it, which show a simple information menu.
But I have no idea about the resources I could use to perform it.
I started with gtk and in particular I found the gtk.status_icon_new_from_file to display an svg icon. But I can't dynamically change the icon's color through the svg. I have to modify the colors in my file, and then to reload it. Is there a way to give directly the data of the icon rather than the name of it ?
Besides, I don't know where to continue then to code my menu. Any idea ?
Finally, is it possible to some text above an icon ?
Edit : I would like to have solution about a generic taskbar, since I'm using tint2 (with openbox) under archlinux. So I need solutions compatible with the freedesktop recommendations and not specific to Gnome or Ubuntu. Maybe solutions with a xfce4 desktop.
Status icon is most generic solution, but legacy.
Appindicator was designed for ubuntu to easy keep icon and menu in taskbar.
There is examples in several languages
http://developer.ubuntu.com/resources/technologies/application-indicators/
What is your Desktop Shell? Each shell has a better way to keep applet on taskbar. Some of these solutions has compatibility with other shells (appindicator has support in KDE, Gnome2, Gnome Shell and maybe others).

Python, transparent window with a red outine of a rectangle

Hi I am new to this whole coding thing I was suggested to use Python. The version I have now is 2.7. I need help with making a transparent window to the copacity of 100 so that you can actually see through it and I also want to know how to make a fairy thick, out line of a rectangle in the colour red.
Help me please :S Thanks!
Unfortunatelly, there is not such an easy thing as sa "trasnparent window" - althougmodern widnow managaers do have various opacity controls for the windows, those just affect the windows as a whole - and do not integrate at all with the program running "inside" the windows. There may even be, for some of them, a way to call functions to explicitly set up the opacity level of a given window, but I don't think it willbe possible for all of them.
That said, it is possible to get grab of the "root" window and draw directly on the screen - -bypassing the window manager. There are APIs for that at least on Windows and Linux (you have to mention in what operating system you need that working) - but it will amount to not a trivial research work, since this is not what is expected of a "well behaved app" - for which the GUI toolkits are written and documented. You will need to write xlib code in Linux, and directly call win32 api's on windows - both are possible from Python - as possible as under-documented.
And once you get to draw the rectangle, since you are bypassing the window manager, you willhave to care about every low-level detail of your app: mouse event handling, screen-redrawing (and notifying the system of drawing taking effect over other windows), and so on.

Categories

Resources