I have a wxPython application I'm bundling into an exe using py2exe. I've defined an icon in the setup.py
file using the following:
setup(
windows=[
{
'script': 'myapp.py',
'icon_resources': [(1, 'myicon.ico')]
},
],
)
This works, but I'd like to be able to access that icon from my wxPython application and use it as the window icon that appears in the top right. Currently I'm using the following to load the icon from the file system:
icon = wx.Icon('myicon.ico', wx.BITMAP_TYPE_ICO, 16, 16)
self.SetIcon(icon)
Which works, but requires that the icon sit beside the EXE, rather than bundled inside it.