递归获取root文件夹里所有mat文件:
# -*- coding: utf-8 -*-
"""
@Author : zhwzhong
@License : (C) Copyright 2013-2018, hit
@Contact : zhwzhong.hit@gmail.com
@Software: PyCharm
@File : mean_and_std.py
@Time : 2019/1/22 19:52
@Desc :
"""
import os
root = '/hdd/zhwzhong/Data/SR'
mat_name = [os.path.join(path, file_name)
for path, _, file_list in os.walk(root)
for file_name in file_list if file_name.endswith('.mat')]