def generate_file_list(): # if os.pa file_list = glob.glob('%s/*.h5' %(FLAGS.hdf5_dir,)) file_list.sort() with open(FLAGS.hdf5_list_path, 'w') as _file: for _file_path in file_list: _file.write(_file_path) _file.write('\n') with open(FLAGS.hdf5_train_list_path, 'w') as _file: for _file_path in file_list[8:]: _file.write(_file_path) _file.write('\n') with open(FLAGS.hdf5_validation_list_path, 'w') as _file: for _file_path in file_list[0:8]: _file.write(_file_path) _file.write('\n')