文件夹及文件的树状显示 if os.path.exists('E:\df'):
for filepath,dirnames,filenames in os.walk(r'E:\df'):
print(filepath)
for filename in filenames:
print(os.path.join(filepath,filename))
else: messagebox.showinfo('提示','异常')