I love tweaking my coding workflow. Small improvements accumulate over time and can lead to a massive productivity increase. Today, I caught myself being annoyed that I always needed to spend three clicks or so just to open a Python file in IDLE, the default Python editor on Windows. Time to change that!
Do you want to open Python files in Windows by just double-clicking on them? Make the IDLE the default editor for Python files in a few simple steps:
- Right-click a Python file, select Properties, and locate the “Opens with” section.
- Click the Change button.
- Select More Apps, scroll down, and click the text Look for another app on this PC.
- Find your Python installation path by running
import sys; print(sys.executable)
in your Python script. - Navigate to the
Lib/idlelib/
path and select the fileidle.bat
. - Click Open and OK to close the Properties Window.
Congratulations! You can now open Python .py
file in IDLE by double-clicking on them. ?
I’ve created a gif to help you nagivate through those steps—but be careful: it’s on my German Windows machine so you may see some strange-looking text snippets:

You can find a slightly more detailed guide here. If you want to learn more tips and tricks on how to save time and be a more productive coder, check out the Finxter email academy with plenty of Python tutorials and downloadable cheat sheets. Sign up here:

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.