import tkinter,tkconstants,tkfiledialog
top.resizable(宽度=假,高度=假)
def openoldfile():
lb2=tkinter.label(text=“old file:”).grid(row=2,column=1,sticky='w')
top.filename=tkfiledialog.askopenfilename(initialdir=“/”,title=“选择新文件”)
lb3=tkinter.label(text=top.filename).grid(row=6,column=2,sticky='w')
b1=tkinter.button(text=“click to open file”,command=openoldfile).grid(row=1,column=2,sticky='w')
b2=tkinter.button(text=“click to open file”,command=opennewfile).grid(row=4,column=2,sticky='w')

.
:当我单击时ButtonB1标签lb3

第二次点击:
![]()