The icon displayed on the taskbar has an executable file. When you invoke the python script, it starts a Python interpreter that has this icon that you want to replace. You can use something like PyInstaller to create an executable file with a custom icon, or if you use the GUI toolkit, you can set the interface icon (for example, SetIcon () in wxWidgets).
source
share