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 3.8 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 3.8 and save your eyes.
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 the Start menu in the Windows Operating System by searching for ‘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?
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.
- 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 a 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.
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:\Python38-32 )
2). In Python38-32 Folder, search for Lib and double click on it.
3). In the Lib folder, search for idlelib folder and double click on it.
4). In idlelib folder, search for CONFIG-HIGHLIGHT.DEF file and open it with any text editor tool like Notepad.
5). In the CONFIG-HIGHLIGHT.DEF file, paste the Monokai Code given in the above section. Save and close the file.
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 🙂
7). Do share this Post if your love your new Python IDLE Look <3, DO share this post in your developer circles as sharing is caring.
Link to Video Tutorial “How to Get dark theme in Python IDLE[3.8]”: https://www.youtube.com/watch?v=4pTRBH5Pa9g
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!