且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在Tkinter中显示图像?

更新时间:2023-02-22 15:41:09

这是一个简单的***小部件,可用于在新窗口中显示图像.

Here is a simple Toplevel widget that you can use to display an image in a new window.

from Tkinter import *

top = Toplevel()
diagrams = PhotoImage(file='your image')
logolbl= Label(top, image = diagrams)
logolbl.grid()

mainloop()