Eyery single tkinter import creates a tkinter window with a winged sign
on the top. Here's a screenshot:
Any ideas how to remove it? Thanks in advance!
I need the answer for Windows, not for UNIX
Eyery single tkinter import creates a tkinter window with a winged sign
on the top. Here's a screenshot:
Any ideas how to remove it? Thanks in advance!
I need the answer for Windows, not for UNIX
As indicated in https://stackoverflow.com/a/18277350/4777984 this is probably the best solution.
import tkinter
import tempfile, base64, zlib
ICON = zlib.decompress(base64.b64decode('eJxjYGAEQgEBBiDJwZDBy'
'sAgxsDAoAHEQCEGBQaIOAg4sDIgACMUj4JRMApGwQgF/ykEAFXxQRc='))
_, ICON_PATH = tempfile.mkstemp()
with open(ICON_PATH, 'wb') as icon_file:
icon_file.write(ICON)
tk = tkinter.Tk()
tk.iconbitmap(default=ICON_PATH)
label = tkinter.Label(tk, text="Window with transparent icon.")
label.pack()
tk.mainloop()
Take a look at this question
Set window icon.
Basically you call root.iconbitmap(path_to_your_icon)
.