def read_subject_names(path):
 folder_names = []
 for (dirname, dirnames, filenames) in os.walk(path):
  for subdirname in dirnames:
   folder_names.append(subdirname)
 return folder_names

def read_subject_names ( path ) : folder_names = [ ] for ( dirname , dirnames , filenames ) in os . walk ( path ) : for subdirname in dirnames : folder_names . append ( subdirname ) return folder_names
reads the folders of a given directory .