0

I use wxpython on windows7 to write a small app. I hope to add an icon for app in the taskbar. My code is :

self.icon = wx.Icon("taskbaricon.ico", wx.BITMAP_TYPE_ICO)
self.SetIcon(self.icon)

It works well in the alt-tab.

But in the taskbar of windows, it just show the defualt python icon:

So how to change the windows taskbar icon? Thank you for your help and a small program demo can be the best!

牛舒舒
  • 11
  • 1
  • 4

2 Answers2

1

This has been raised before, and I think the answers here can will solve your problem wxpython icon for task bar

It's not technically possible on Windows but the answers here list a few ways to get it to work, mostly through py2exe.

Community
  • 1
  • 1
grimpunch
  • 51
  • 3
  • I have seen the links you give before I ask my question. I do not want to make my app to an exe. So may be there is no way to solve the icon problem – 牛舒舒 Apr 09 '15 at 13:11
0

The way I do it is first to develop the whole application, then compile the application using pyinstaller. First open the command prompt and change the working directory to the one your application is located and then execute the following command, pyinstaller --windowed --icon="icon.ico" your_main_script.py assuming the icon you want to use is called icon.ico. I find pyinstaller easier to use than py2exe and is available for the 2.x and 3.x versions of pyhton.