How to Open Python .py Files in IDLE with a Doubleclick?

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:

  1. Right-click a Python file, select Properties, and locate the “Opens with” section.
  2. Click the Change button.
  3. Select More Apps, scroll down, and click the text Look for another app on this PC.
  4. Find your Python installation path by running import sys; print(sys.executable) in your Python script.
  5. Navigate to the Lib/idlelib/ path and select the file idle.bat.
  6. 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:

How to Open Python .py Files in IDLE with a Doubleclick?

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: