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

前端 未结 1 404
遇见更好的自我
遇见更好的自我 2020-12-20 20:06

I\'m developing a Python script to do file management on Windows. Essentially, I want to be able to move files to another location, and create in their place a shortcut to a

相关标签:
1条回答
  • 2020-12-20 20:30

    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.

    0 讨论(0)
提交回复
热议问题