python 获取某个文件下的所有文件
1 import os 2 files = os.listdir(load_Graph_file_path) 3 cnt = 0 4 for file in files: 5 print(file) 6 if (os.path.splitext(file)[0][0] == 'G' and os.path.splitext(file)[1] == '.npy' ): 7 all_Graph[cnt] = np.load(load_Graph_file_path+'/'+file).item() 8 cnt = cnt + 1