import os
def list_file_or_folder(path_name):
file_folder_name = os.listdir(path_name)
for name in file_folder_name:
temp_path_name = path_name + "/" + name
if os.path.isdir(temp_path_name):
print("%s 是文件夹" % name)
list_file_or_folder(temp_path_name)
else:
print("%s 是文件" % name)
list_file_or_folder("./aa")
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)