在未来,我计划添加不同的图像,因此测试用彩色图像创建的油漆,而不是内置的命令,以显示颜色。我将在代码之后添加下面的结果。# importing the moduleimport tkinter.messagebox# importing themodule
class window(Frame):
def __init__(self,master = N
我有一个tkinter窗口,它构建了必要数量的按钮,相应地命名它们,然后显示相应的图像。我想让按钮在按下时打印与图像相对应的正确文件名。我尝试过lambda,但它只会传递最后一个参数。我该怎么做呢?my_image b = Button(window, text=f'button {(c+1)}', command=lambdaprint_filename(i))
b.grid(row=0, col
到目前为止,一切都很好:我使用了按钮,tkinter.PhotoImage。(height=500, width=500)elso=tkinter.PhotoImage(file='first.png')masodik=tkinter.PhotoImage(file='second.png')
#thirdpicture is se