首页 > 解决方案 > 我正在尝试为我的代码的一部分导入图像,但它没有显示,但是它在不同的部分中进一步显示

问题描述

代码不显示图像

home = PhotoImage(file = 'homebutton.png')
Button(hotfood, image = home, bg = 'white', command = 
hotfood.destroy).grid(row = 0, column = 0, sticky = EW)
return home

代码显示图像

logo = PhotoImage(file = 'logo.PNG')
Label (order, image = logo, bg = 'white').grid(row = 0, column = 0, 
sticky = E)

标签: pythontkinterphotoimage

解决方案


推荐阅读