tkinter 图标不显示问题
tkinter.TclError:bitmap“xxx.ico” not defined
解决办法:
安装pip3 install pillow
import tkinter
from PIL.ImageTk import PhotoImage
tkc = tkinter.Tk()
img = PhotoImage(file="11.ico")
tkc.tk.call('wm', 'iconphoto', tkc._w, img)
tkc.mainloop()
...
原创
2022-05-23 16:05:53 ·
1208 阅读 ·
0 评论