Start Searching the Answers
The Internet has many places to ask questions about anything imaginable and find past answers on almost everything.
The Question & Answer (Q&A) Knowledge Managenet
The Internet has many places to ask questions about anything imaginable and find past answers on almost everything.
How do you color a comment in Python?
sublime-color-scheme works.
By default, idle works in classic mode and can be tuned to work in a dark mode.
For text window backgrounds, go to Options => IDLE Preferences => Highlighting tab. Save the builtin theme (both are the same) as a custom theme, with a new name. Change the background of each element with a white background to the color you want. Hit Apply or OK.
On mine it’s Tools > Preferences > Editor and “Syntax Color Scheme” dropdown is at the very bottom of the list. At First click on preferences(Ctrl+Shift+alt+p) then click the option of syntax coloring and change the scheme to “Monokai”. Now apply it and you will get the dark scheme.
7oao commented on Feb 20, 2015
Change the background of each element with a white background to the color you want. Hit Apply or OK. Alternatively, copy the following into /.idlerc/config-highlight.cfg (which may or may not exist already) and change #ffffff to your desired color. We just added an IDLE Dark theme with a deep cobalt blue background.
UPDATE: It seems to be controlled by the ‘warning’ setting for python colors. Shouldn’t it get its own section? Python doesn’t have the concept of block comments.
Hotkey/Keyboard Shortcut in Python IDLE editor: If you want to comment out a block of code, then select the lines which need to be commented on Python IDLE editor and press Alt+3 Similarly for uncommenting a region or block of code, select the lines and press Alt+4 You can check for more keyboard shortcuts in the Format menu in the IDLE editor.
‘ # ’ is used to comment a line in python. If you want to comment out a block of code, then select the lines which need to be commented on Python IDLE editor and press Alt+3 You can check for more keyboard shortcuts in the Format menu in the IDLE editor.