首页 > 解决方案 > tkinter.TclError:图像“pyimage45”不存在

问题描述

我正在尝试将yt.py具有图像标签和按钮的 python 模块导入到fpassm.py单击时具有图像按钮的 python 文件,但它给了我一个错误 _tkinter.TclError: image "pyimage45" doesn't exist

ytphoto=PhotoImage(file='youtube.png')
yt=Button(root,image=ytphoto,borderwidth=0, activebackground='#ffffff', command = youtube)
ytsize=ytphoto.subsample(1,1)
yt.config(image=ytsize,bg='#fdffff')
yt.place(x = 300,y = 100)

标签: pythontkinter

解决方案


推荐阅读