#! /usr/bin/python ‘‘‘ show dirs ‘‘‘ import os #Get all files and directories def get_cur_list(path): cur_files = os.listdir(path) all_files = [] for file_name in cur_files: full_name = os.path.join(path, file_name) all_files.append(full_name) if os.path.isdir(full_name): next_level_files = get_cur_list(full_name) all_files.extend(next_level_files) return all_files
时间: 2024-10-05 23:15:48