How to find via Python the icon associated with a Windows file? How to find via Python the icon associated with a Windows file? shell shell

How to find via Python the icon associated with a Windows file?


File type information is found in the registry. You could look up the file extension's type with the windows registry module.

Edit: It appears icons are available through shell32, as seen here. The Python equivalent seems to be ctypes.windll.shell32.ExtractIconA, though I'm not sure about the syntax.