Python’s IDLE code editor comes with every standard Python installation in Windows, Linux, and macOS. You can use it right out of the box after installing Python on your computer.
Related Article: How to Install Python?
IDLE has a useful syntax highlighting feature that highlights different Python language features to help you grasp source code faster:
- Python keywords may be colored orange.
- Function names may be colored blue.
- Strings may be colored yellow.
- Variable names may be white.
You can change the syntax highlighting theme by clicking
Options > Configure IDLE and switching to the
Here’s how I changed the code highlighting theme in my own IDLE from a dark to a light theme and back:
You can choose among the following three default themes:
- IDLE Classic
- IDLE Dark
- IDLE New
Here are all three variants available in the IDLE editor per default for you to compare. Which one do you like most?
What if IDLE doesn’t highlight your syntax but the code appears in black color only?
The most common source of this problem is that you opened a file with another file suffix than
.py, for example a text file
.txt or a data file
.dat. The IDLE editor will highlight only Python’s standard
.py files. To fix this issue, simply rename the file from the non-Python file suffix to the Python file suffix. For example, rename the file from
code.py and reopen the file. As a result, the code will be highlighted in IDLE.
Here’s an example of the same code opened as a
.txt and as a
.py file—being highlighted only in the latter case.
Thanks for taking the time to read over this article! Frankly, I still use IDLE for many of my Python projects because it opens much faster than PyCharm. If I just want to script some quick problem, nothing is as fast and efficient as opening the IDLE program in your operating system and get going instantly.
Check out our free email academy to become a better Python coder (and download some PDF cheat sheets too!):
Where to Go From Here?
Enough theory, let’s get some practice!
To become successful in coding, you need to get out there and solve real problems for real people. That’s how you can become a six-figure earner easily. And that’s how you polish the skills you really need in practice. After all, what’s the use of learning theory that nobody ever needs?
Practice projects is how you sharpen your saw in coding!
Do you want to become a code master by focusing on practical code projects that actually earn you money and solve problems for people?
Then become a Python freelance developer! It’s the best way of approaching the task of improving your Python skills—even if you are a complete beginner.
Join my free webinar “How to Build Your High-Income Skill Python” and watch how I grew my coding business online and how you can, too—from the comfort of your own home.
While working as a researcher in distributed systems, Dr. Christian Mayer found his love for teaching computer science students.
To help students reach higher levels of Python success, he founded the programming education website Finxter.com. He’s author of the popular programming book Python One-Liners (NoStarch 2020), coauthor of the Coffee Break Python series of self-published books, computer science enthusiast, freelancer, and owner of one of the top 10 largest Python blogs worldwide.
His passions are writing, reading, and coding. But his greatest passion is to serve aspiring coders through Finxter and help them to boost their skills. You can join his free email academy here.