Custom theme python idle

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

A custom Python IDLE colour theme based off of Atom’s One Dark theme.

wlwww16/IDLE-One-Dark-Theme

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

A custom Python IDLE colour theme based off of Atom’s One Dark theme.

  1. Ensure IDLE is closed.
  2. Open your file explorer.
  3. Go to your idlerc directory. On Windows, it’s C:\Users\%username%\.idlerc .
  4. Copy the new config-highlight.cfg file from here.
  5. Open IDLE, click on «Options» at the top of the window, click «Configure IDLE», open the «Highlighting» tab, choose «a Custom theme» and click on «Atom One Dark.»
  6. Apply and exit.
  7. Enjoy.

Go to https://github.com/LumiteDubbz/IDLE-One-Dark-Theme/blob/master/Screenshot.png?raw=true if this image did not load.

Some colours are not perfect, this is because IDLE’s customisation menus are not the most extensive. Nothing I can do about it ¯\_(ツ)_/¯

About

A custom Python IDLE colour theme based off of Atom’s One Dark theme.

Источник

Custom IDLE Themes Tutorial

In this post I will teach you how to use custom color schemes with IDLE, Python’s built-in IDE. Using custom IDLE themes is a great way to make your editor more intuitive and boost your productivity by adjusting how IDLE highlights your code. Personally I find it much harder to write my code if my editor has an uncomfortable or straining color theme. Too much contrast between the background and foreground can be very straining on your eyes and make it difficult to read your own code. A theme that doesn’t work well for you can be confusing or simply unintuitive, as you may be expecting a certain piece of code to be highlighted in one color, but your IDE is using a totally different style. Perhaps your code comments are being shown in a bright red when you would like them to be more subdued.

To select between the default themes, go to Options > Configure IDLE and navigate to the Highlights tab. On the right side of the panel, there will be two radio buttons to choose between default themes or custom ones. Choose your theme from the dropdown list and click the Apply button at the bottom of the window. The theme is now activated and you will see the changes in your IDLE window.

You can also make changes to your themes in the Highlights tab. Under “Custom Highlighting” you will see a dropdown list where you can select a particular item to edit. For each item, you can edit both the foreground and background color by clicking the “Choose Color for:” button with either “Foreground” or “Background” selected. You can see a preview of your changes on the left side of the window. When you’re finished editing the highlight colors, click on the button labeled “Save as New Custom Theme” underneath the preview pane, and enter a name for your theme, then click Save.

Now, on to the themes files. If you prefer to edit your themes via the Settings menu, then you don’t need to mess with these files. But if you find a theme on the internet that you want to use, then this is how you will install them.

The default built-in themes are located in a file called config-highlight.def , which on Windows will be located in your Python installation directory with a location such as C:\Python39\Lib\idlelib\config-highlight.def . You should not edit this file, as it only serves to define the default themes – but if you want to base your custom theme on one of these, then you can copy them from here and paste your new version into the custom themes file discussed in the next paragraph.

On Windows, the file you want to edit to add new highlight themes is C:\Users\\.idlerc\config-highlight.cfg . On most Linux distros this file will be located in your home directory at /.idlerc/config-highlight.cfg . You may have to create it if it doesn’t already exist; but if you have saved any custom themes from the Settings menu in IDLE, then the file will be here. Note the different extension – the filenames are similar, but the custom themes file has a .cfg extension while the built-in themes file has a .def extension.

To sum it up, the 2 files in question are:

A custom highlight theme will look something like this, which you will copy & paste into config-highlight.cfg :

[Obsidian]definition-foreground = #678CB1
error-foreground = #FF0000
string-background = #293134
keyword-foreground = #93C763
normal-foreground = #E0E2E4
comment-background = #293134
hit-foreground = #E0E2E4
builtin-background = #293134
stdout-foreground = #678CB1
cursor-foreground = #E0E2E4
break-background = #293134
comment-foreground = #66747B
hilite-background = #2F393C
hilite-foreground = #E0E2E4
definition-background = #293134
stderr-background = #293134
hit-background = #000000
console-foreground = #E0E2E4
normal-background = #293134
builtin-foreground = #E0E2E4
stdout-background = #293134
console-background = #293134
stderr-foreground = #FB0000
keyword-background = #293134
string-foreground = #EC7600
break-foreground = #E0E2E4
error-background = #293134

Copy this theme definition into your config-highlight.cfg file, with a blank line separating each theme. The colors for each item are in hex format, and the name of the theme will be in brackets at the beginning of each theme definition. The next time you open IDLE, it will read your custom highlight themes automatically and you will be able to select them in the Preferences window.

I have uploaded for you a sample themes file containing several custom themes. Place the config file at C:\Users\\.idlerc\config-highlight.cfg (if using Linux, then ~/.idlerc/config-highlight.cfg ). I did not create the themes in it, so please appreciate the efforts of the original authors. You are free to use it as you wish.

Источник

dsosby / config-highlight.cfg

This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters

[Obsidian]
definition-foreground = # 678CB1
error-foreground = # FF0000
string-background = # 293134
keyword-foreground = # 93C763
normal-foreground = # E0E2E4
comment-background = # 293134
hit-foreground = # E0E2E4
builtin-background = # 293134
stdout-foreground = # 678CB1
cursor-foreground = # E0E2E4
break-background = # 293134
comment-foreground = # 66747B
hilite-background = # 2F393C
hilite-foreground = # E0E2E4
definition-background = # 293134
stderr-background = # 293134
hit-background = # 000000
console-foreground = # E0E2E4
normal-background = # 293134
builtin-foreground = # E0E2E4
stdout-background = # 293134
console-background = # 293134
stderr-foreground = # FB0000
keyword-background = # 293134
string-foreground = # EC7600
break-foreground = # E0E2E4
error-background = # 293134

In my pc, configure file is in(Python 3.5.1 x64 in Windows 7) :
C:\Users.idlerc

Very nice. Any idea how to let decorators like @classmethod have a different color?

I don’t see the .idlerc file. 🙁

Is there anyway to change the font?

Very nice theme. Thanks a lot.
On windows 10, using Pythin 3.4, I had to update «C:\Python34\Lib\idlelib\config-highlight.def» file.

Ty for the theme and help with Windows 10. Using Python 3.5. This theme has lasted some years!

Thanks I’ve forked because I like the colours but prefer a perfectly black background instead of the greyish one in this theme.

Ever since installing Idle3 I can not use the «options / configure» menu item — the program freezes and a bunch of errors on the command line. Don’t know what to do — everything else works, Idle3 a great editor for Python3.5 [Linux Fedora 24 64bit]. But I guess I just gotta stay with the default white look . (

Thank you! Continues to be useful. Am on Windows 10, but used duphenix’s method (Sep 28, 2012 comment). Saved one of the existing themes as a custom theme, so the config-highlight.cfg was auto-created, then pasted the Obsidian data in it.
On Windows 10, the .idlerc folder was in my user folder.

Eye-saving theme, thank you!

As above, on Windows 10 my config-highlight.def file was found at C:\WinPython\python-3.6.1.amd64\Lib\idlelib and I was able to paste the Obsidian theme in there.

Thankyou this is amazing! (x2)

Brilliant, just what I was looking for, thankyou

beautiful them , Thanks a lot.

I couldn’t save «config-highlight.def» file after editing it in the «\Python34\Lib\idlelib» folder, So i had to move the file «config-highlight.def» to «C:\Users\User.idlerc» folder, then i edited it and saved the file in «C:\Users\User.idlerc» folder, after that i returned the file in «\Python34\Lib\idlelib» folder, I’ve struggled so much but finally it worked.

As listed above, For Python 3.6.4 x64 in Windows 10:

C:\Users\AppData\Local\Programs\Python\Python36\Lib\idlelib\config-highlight.def, then add the code to the end of the file.

Ensure IDLE is closed first, then edit the file and save then close. Then open IDLE and navigate to Options > Configure IDLE > and select the «Hightlighting Theme» button underneath a Built-in Theme (unless you are already using ‘a Custom Theme); by default it will read, «IDLE Classic» so click it and select «Obsidian» from the drop-down menu. If you want it to fit in nicely, you can open the config-highlight.def file and change [Obsidian] to [OBSIDAN].

Thanks to everyone in the comments above that made this doable using the latest software on the latest build of Windows 10 and for the OP for such an awesome schema I didn’t have to manually customize myself.

[IDLE Obsidian]
definition-foreground = #678CB1
error-foreground = #FF0000
string-background = #293134
keyword-foreground = #93C763
normal-foreground = #E0E2E4
comment-background = #293134
hit-foreground = #E0E2E4
builtin-background = #293134
stdout-foreground = #678CB1
cursor-foreground = #E0E2E4
break-background = #293134
comment-foreground = #66747B
hilite-background = #2F393C
hilite-foreground = #E0E2E4
definition-background = #293134
stderr-background = #293134
hit-background = #000000
console-foreground = #E0E2E4
normal-background = #293134
builtin-foreground = #E0E2E4
stdout-background = #293134
console-background = #293134
stderr-foreground = #FB0000
keyword-background = #293134
string-foreground = #EC7600
break-foreground = #E0E2E4
error-background = #293134

Источник

Читайте также:  Html tables using php
Оцените статью