Python2 查找某个目录下面的所有文件
def getfile(dir_file): baseUrl = dir_file fileList = [] list = os.listdir(baseUrl) for i in range (0, len(list)): path = os.path.join(baseUrl,list[i]) if os.path.isfile(path): fileList.append(list[i]) else: pass return fileList