You can use this too replace the Tkinter
default icon.
import base64, PIL, urllib, Tkinter
from Tkinter import *
from PIL import ImageTk
from urllib import *
root = Tk()
raw_data = urllib.urlopen("http://dl.dropboxusercontent.com/s/qtlincxkbbiz1qv/stat.gif").read()
b64_data = base64.encodestring(raw_data)
image = PhotoImage(data=b64_data)
root.tk.call('wm', 'iconphoto', root._w, image)
root.mainloop()
And then change the .py
file extension to .pyw
to change the taskbar icon.
The .pyw
extension tells it to run with pythonw.exe
instead of python.exe
, but running with pythonw.exe
also makes it run without the console.
So, you'll either have to run without the icon, or without the console.