[PythonCE] File association image for .py

Alex Mandel tech_dev at wildintellect.com
Mon Jul 24 21:54:33 CEST 2006


Luke Dunstan wrote:
> ----- Original Message ----- 
> From: "Alex Mandel" <tech_dev at wildintellect.com>
> To: <pythonce at python.org>
> Sent: Friday, July 21, 2006 5:13 AM
> Subject: [PythonCE] File association image for .py
> 
> 
>> I know it's a little trivial but it's the kind of thing that end users 
>> really like. Anyone know how to add a registry entry so the .py files 
>> get a nice python icon in the File Explorer.
> 
> Create a registry key: HKEY_CLASSES_ROOT\Python.File\DefaultIcon
> Set the default value of this key to: \Program Files\Python24\python.exe,0
> 
>> I'm assuming that it can be done in the PythonCE.inf for the CAB but I 
>> don't know the syntax. If someone knows how, I think it should be added 
>> to the next release.
> 
> Yes, it will be in the next release.
> 
> Luke

Thanks for the info Luke.

The correct syntax for the inf file is(All as one Line):
HKCR,Python.File,DefaultIcon,0x00000002,"\Program 
Files\Python24\python.exe,0"; DefaultIcon = "\Program 
Files\Python24\python.exe,0"

In the examples I was looking at I wasn't sure what the section after 
the semi-colon was for, it may not be necessary. But I test this line 
and it worked.

Now the only question is if it should be a different icon from the Shell 
exe or if the console-less .pyw should be a different icon than the others.

Alex



More information about the PythonCE mailing list