tags: python
iconBitmap () requires oneicoType bit graph parameters are used as window icons, and other types such as .png.jpg cannot be displayed.
import tkinter as tk
window = tk.Tk()
window.title('LookAtMyLOGO') # Change the title name
window.geometry('400x450')
window.iconbitmap('logo01.ico') # Change the window icon
window.mainloop()
TK.Call () is the interface of TKINTER to the TCL interpreter, and run the TCL command with the call method.
Set the picture that wants to be set to logo totk.PhotoImage。Otherwise there will be errors: tkinter.tclerror
That is, the previous parameters are unchanged, and the final file = the subsequent string is changed to the PNG type picture you want to replace. PNG format! Intersection
import tkinter as tk
window = tk.Tk()
window.title('LookAtMyLOGO') # Change the title name
window.geometry('400x450')
window.tk.call('wm', 'iconphoto', window._w, tk.PhotoImage(file='logo02.png'))
# Change the window icon
window.mainloop()
iconphoto ().pngThe picture is set to the window logo.just .png format
import tkinter as tk
window = tk.Tk()
window.title('LookAtMyLOGO') # Change the title name
window.geometry('400x450')
window.iconphoto(False, tk.PhotoImage(file='logo03.png'))
# FALSE: This image uses only this window instead of the TOPLEVELS window created in the future
# Set to TRUE: It will be suitable for all TOPLEVELS windows that are later created
window.mainloop()
You can download .png format picture directly
Win10 system Click on the small icon on the right, there is no time format setting, you need to find: 1. Open ‘’Settings’’, open ‘’Time and Language’’ &...
Android emulator environment genymotion 7.0 After restarting, the apk will be installed automatically, and some permissions can be obtained, such as adjusting the system brightness Real machine mode T...
Windows system wants to quickly set the startup to automatically start a certain program, you can use the following methods to set: The first type: set startup items 1. Find the startup folder, mine i...
One: Open Signing under File->Project Structure->Modules and create a new Signing with any name; Or add the following code in the app's gradle, the effect is the same. 2: Add the following code ...
1.File-Settings 2.Editor- Code Style - File and Code Templates - Python Script What needs to be set can be written now, related variables refer to: 3. After setting, click ok or apply. After my collea...
Sometimes, when I see the token issued by others have its own logo, it looks very handsome~ Why don’t I have the token issued by myself? As for how to issue your own token, please refer toTron i...
qrcode generates a QR code with its own LOGO Library dependency origin Code Upload the generated QR code to Qiniu Library dependency origin Company Mini Program activities should be shared in the QR c...
I saw that the group friends were playing this WSL these days, just installing a Linux on Win, and then I thought to play with it, hehe. 0. How to install WSL Here I refer to the blog of technology fa...
1. Documents used leaflet.css jquery-1.11.1.min.js leaflet.js leaf-green.png leaf-orange.png leaf-red.png leaf-shadow.png This Liezi is quite simple. The pictures of Liezi given by the official websit...
Convert picture format to ico format using python First install the PythonMagick package, install directly using pip, or go to https://www.lfd.uci.edu/~gohlke/pythonlibs/#pythonmagick to download the ...