Whenever I run my python code, the window do not have any icon..
How to change it some icon or the icon I want to assign?
I can assign a good icon for the exe generated thru py2exe.
I want to assign icon for the window opened after double clicking the code (*.pyw)
(I am using wxWidgets)
Thanks
Mahesh

Recommended Answers

All 2 Replies

I assume you use wxPython because it's python and not c++(=wxWidgets)

Add this to the set_properties function

_icon = wx.EmptyIcon()
_icon.CopyFromBitmap(wx.Bitmap("./logo.gif", wx.BITMAP_TYPE_ANY))
self.SetIcon(_icon)

Thaks kruptein.
1. _icon = wx.Icon('./icons/logo2.ico', wx.BITMAP_TYPE_ICO)
This line worked for me.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.