Python Forum

Full Version: how to remove icon
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hello everyone, I am new to python GUI creation and I would like to know how to remove the application icon
Regards,
Ilyess
Which application? Most will allow you to replace them.
(Oct-15-2021, 06:26 AM)menator01 Wrote: [ -> ]Which application? Most will allow you to replace them.

İmage
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()
(Oct-15-2021, 09:38 AM)menator01 Wrote: [ -> ]
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()

Thanks you !