I am trying to set an icon in my wxpython program. So far, after reading many pages and examples, I was able to set an icon at the window, which also works when using alt+ta
I have found a fix to the problem described in my second answer in another SO question/answer which is PyQt related. Add this code to your application before the GUI is created:
import ctypes
myappid = 'mycompany.myproduct.subproduct.version' # arbitrary string
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(myappid)
The icon will be set correctly with either taskbar buttons settings.
Explanation can be found here: https://stackoverflow.com/a/1552105/674475