import os
all_file = []
def gci(filepath):
#遍历filepath下所有文件,包括子目录
files = os.listdir(filepath)
for fi in files:
fi_d = os.path.join(filepath,fi)
if os.path.isdir(fi_d):
gci(fi_d)
else: # 可以在这里加判断,使得满足特定后缀的的文件才能append
all_file.append(os.path.join(filepath,fi_d))
gci('/content/MSMT17_V1')
file_list = all_file