Python如何进行有背景图片的界面跳转

一、问题
在进行tkinter点击按钮弹出新的界面的时候遇到了下面的问题:
【_tkinter.TclError: image "pyimage2" doesn't exist】

原因是因为这个photoimage只能加载一次,不能再次使用,因此需要的使用另外一种方式来完成界面的跳转。

二、解决
在跳转的界面使用tk.Toplevel()就可以完成界面的跳转

三、结果


四、总结
附上stackflow博主的地址:https://stackoverflow.com/questions/26097811/image-pyimage2-doesnt-exist
问题解答地址:https://stackoverflow.com/questions/20251161/tkinter-tclerror-image-pyimage3-doesnt-exist

原文地址:https://www.cnblogs.com/future-dream/p/10932575.html