Login

Please fill in your details to login.





open py files in idle with double click

This page is mainly about open py files in idle with double click
One of the minor irritations of Python is that double clicking a
.py
files in Windows Explorer runs the
.py
script in Python for Windows rather than opening it for editing in Idle, the build in Python editor.

There are lots of solutions around the web which involve changing the file association for
.py
files to Idle using the
idle.bat
file which is in
c:\Program Files\Python 3.11\Libs\idlelib\
. Whilst this works, it's not the best solution for me, mainly because a shell window flashes up before Idle opens (I know, I know. It's not that important).

The more elegant solution is to make a simple change in the registry.

1
Open registry editor.

Click 'Start' and type
registry editor
and press ENTER

2
Locate the registry key

Navigate to
Computer\HKEY_CLASSES_ROOT\Python.File
. Hopefully, if you expand the sub-keys, you should see the following.

image
Python.File registry key

The three main sub-keys define the icon for the file, context menu and double click behaviour and integration with shell extensions.
Last modified: February 14th, 2024
The Computing Café works best in landscape mode.
Rotate your device.
Dismiss Warning