First you will need to register your script to run with Python under ProgId in the registry. At a minimum, you will need an open verb:
HKEY_CURRENT_USER\Software\Classes\MyApp.ext\ (Default) = "Friendly Name" DefaultIcon\ (Default) = "path to .ico file" shell\ open\ command\ (Default) = 'path\python.exe "path\to\your\script.py" "%L"'
You can replace HKEY_LOCAL_MACHINE if you are installing a machine language. * There are also version conventions that you can probably ignore. The MSDN section in File Types contains more detailed information.
The second step is to add ProgId to the OpenWithProdIds key of the extension you want to display in the list, for:
HKEY_CURRENT_USER\Software\Classes\.ext\OpenWithProgIds MyApp.ext = None
The key value does not matter if the name exactly matches your ProgId.
* Please note that HKEY_CLASSES_ROOT is actually a fake key that "contains" a combination of both HKLM\Software\Classes and HKCU\Software\Classes ; if you are writing to the registry, you must select one of the actual keys. You do not need to raise to set to HKEY_CURRENT_USER .
source share