tkinter为多个窗口设置相同的icon报错

import threading
import tkinter

from PIL import Image, ImageTk


def show_window():
    window = tkinter.Tk()
    img = Image.open("../teller/res/tell.jpg")
    photo = ImageTk.PhotoImage(img)
    window.wm_iconphoto(window, photo)
    window.mainloop()


threading.Thread(target=show_window).start()
threading.Thread(target=show_window).start()
threading.Thread(target=show_window).start()
_tkinter.TclError: can't use "pyimage2" as iconphoto: not a photo image
相关文章
相关标签/搜索