How to Get Dark Theme in Python IDLE

Dark Theme in Python IDLE – Version 2.7

Python is a high- level, general-purpose, interactive, interpreted and object-oriented programming language. It was developed in 1991. As Python allows the programmer to write programs and instruction using fewer lines of codes, it has caught the attention of Millions of Developers.

If you are a Python Developer and especially a night-owl programmer, this hack is for you which will transform your Python IDLE 2.7 in Dark Theme which will reduce your eye strain in low light conditions. If you want to feel Monokai Theme of Sublime Text, then go ahead and add the Dark theme to your Python IDLE 2.7 and save your eyes.

Also Read: Dark Theme in Python IDLE – Version 3.8

What is Python IDLE?

Python IDLE which stands for “Integrated Development and Learning Environment” is an integrated development environment (IDE) for Python Programming Language and is by default installed with the Python installer for Windows.

You can open Python IDLE from Start menu in Windows Operating System by searching for ‘IDLE’.

open-python-idle

In the case of Python distributions for Linux and macOS, Python IDLE is not available by default.

For Ubuntu Linux, You can install the Python IDLE with the help of the following command:

$ sudo apt-get install idle

Python IDLE is used for executing single line python statements. Developers basically use Python IDLE to develop, modify, execute and debug Python scripts. Python IDLE provides a fully-featured and efficient text editor to write Python scripts. It also includes some awesome features like syntax highlighting, autocompletion and smart indent. Developers love IDLE as it provides the debugger with stepping and breakpoints features.

You can download Python from it’s an official site which automatically comes with Python IDLE.

Also Read: Top Free Python Udemy Courses

Why you should add dark theme to your Python IDLE?

wet-eyes

The programmers are the main source of income for eye doctors 🙁

The dark themes are getting more and popular nowadays for night-owl programmers. Some people just like the vibe, while others use dark themes simply to reduce eye strain and save battery.

Pros:

  • Dark themes can reduce eye strain in low-light conditions, more specifically at night time.
  • High contrast between foreground and background reduces eye strain.
  • Syntax highlighting on Python IDLE  can be easier to read with dark themes like monokai.

Adopt Dark Theme and Happy Coding while protecting your most precious organ – ‘Eye’!

Python IDLE Dark Theme Code [Monokai Theme]:

Below is the code for adding Dark Theme in Python IDLE which you will require in the next section describing steps for adding dark theme to your python IDLE.

The Monokai Theme code changes the syntax highlighting and various text editor component’s colors including foreground and background.


[monokai]

normal-foreground= #F8F8F2
normal-background= #272822
keyword-foreground= #F92672
keyword-background= #272822
builtin-foreground= #66D9EF
builtin-background= #272822
comment-foreground= #75715E
comment-background= #272822
string-foreground= #E6DB74
string-background= #272822
definition-foreground= #A6E22E
definition-background= #272822
hilite-foreground= #F8F8F2
hilite-background= gray
break-foreground= black
break-background= #ffff55
hit-foreground= #F8F8F2
hit-background= #171812
error-foreground= #ff3338
error-background= #272822
cursor-foreground= #F8F8F2
stdout-foreground= #DDDDDD
stdout-background= #272822
stderr-foreground= #ff3338
stderr-background= #272822
console-foreground= #75715E
console-background= #272822

Steps to Add Dark Theme to Your Python IDLE:

1). Open Python Folder from the path you selected during installing Python. In this case it is ( C:\Python27 )

How to Get dark theme in Python IDLE[2.7] - Step 1

2). In Python27 Folder, search for Lib and double click on it.

How to Get dark theme in Python IDLE[2.7] - Step 2

3). In the Lib folder, search for idlelib folder and double click on it.

How to Get dark theme in Python IDLE[2.7] - Step 3

4). In idlelib folder, search for CONFIG-HIGHLIGHT.DEF file and open it with any text editor tool like Notepad.

How to Get dark theme in Python IDLE[2.7] - Step 4

5). In the CONFIG-HIGHLIGHT.DEF file, paste the Monokai Code given in the above section. Save and close the file.

How to Get dark theme in Python IDLE[2.7] - Step 5

6). Now Restart your system, Open Python IDLE, From the menu bar select Options -> Configure IDLE -> Highlighting & You will see the monokai theme in Highlighting themes section. Select Monokai theme and Enjoy 🙂

How to Get dark theme in Python IDLE[2.7] - Step 6

 

Link to Video Tutorial “How to Get dark theme in Python IDLE”: https://www.youtube.com/watch?v=4pTRBH5Pa9g

Conclusion:

Finally concluding this article subjected, How to Get dark theme in Python IDLE and execute python scripts like a pro without spoiling your eyes.

We have included the topics; What is Python IDLE?, How to install Python IDLE on your System?, Why you need to add a dark theme to your python IDLE? and Steps to add a dark theme to your python IDLE.

I hope this piece helped you and satisfies the reason for you being here, and if you have any queries or questions related to this thread, then please make a comment below and let me help you with that concern.

Happy Coding and protect your Eyes!

LEAVE A REPLY

Please enter your comment!
Please enter your name here