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
相關文章
相關標籤/搜索