In 90% of cases, I’m using the out-of-the-box IDLE editor to write small scripts and Python programs. It’s lightweight, simple, and provides basic functionality such as syntax highlighting in shell and Python files.
To use IDLE, simply install Python and type “IDLE” into your operating system search bar. This should work for Linux, Mac, and Windows operating systems.
You can use an interactive session where the Python interpreter executes all your commands directly. Or you can create a new file with “.py” suffix to indicate that it’s a Python file — and execute the Python file at once simply by running the code.
I know that many coders prefer other editors such as PyCharm. But I would recommend PyCharm only if you have larger projects with multiple Python files. As Python is a scripting language, it really depends on the application scenario whether I would use PyCharm or IDLE.
- If I want to execute a small program or script with one or two files using default libraries, I use the IDLE project.
- If I want to execute a larger program and use different external dependencies specifically for this project, I use PyCharm with a virtual environment to handle the different libraries.
If you have any other editor that beats my simple setup, please let me know by commenting below so that I can address it in a future article.
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.