python - 我正在尝试为我的代码的一部分导入图像,但它没有显示,但是它在不同的部分中进一步显示
问题描述
代码不显示图像
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)
解决方案
推荐阅读
- tcl - 包“Tk”的版本冲突:有 8.6.8,正好需要 8.6
- android - 在 onCharacteristicWrite 上获取状态 9
- scala - 字符串转换表达式的 Spark、Scala 和 eval
- c# - 计算日期范围内的天数c#
- android - API 级别 28 上未显示 AlarmReceiver 通知
- c# - C# UWP DataReader 异常 HRESULT: 0x8000000B
- javascript - 什么会导致输入占位符隐藏?
- c - 可执行和可链接格式(.elf)和对象(.o)文件之间的区别
- laravel - Laravel 关系对不同模型使用相同的文件表
- php - SonataAdmin 子管理路由在调试中可见但未找到