我用askopenfilename
打开了这个目录。
但是,我不想打开该文件,我需要它,只是为了查看该特定路径中存在的文件。
我想在单击框架中的按钮后查看路径文件夹内容。
不仅要看到路径中的内容,还要来回移动。
所以我想删除最后的选项(Datename,open,close)
不管怎样我都能解决这个问题
这是我用过的代码: f1=框架(根) 对于帧输入(f1): frame.grid(行=0,列=0)
frame1 = ttk.LabelFrame(f1, text="Data")
frame1.grid(row=1, column=5, padx=(30,10), pady=(10,0), columnspan=2)
b01 = ttk.Button(frame1, text="New", compound = "left", width=12, command=Dir_Data)
b01.grid(row=4, column=5, padx=20, pady=5, ipadx=5, ipady=5)
def Dir_Data():
directory = "C:\Req_file\date_files"
temp = filedialog.askopenfile(initialdir=directory)
目前没有回答
相关问题 更多 >
编程相关推荐