from glob import glob
# use string for accessing a certain path
data_path = '/home/clay/userdata/BeatlikeMichael/drumVAE-main/groove/drummer1'
# both glob and rglob can access to number of directory by using *
for dir_path in glob(data_path+'/session*'):
for file_path in glob(dir_path+'/*.mid'):
from pathlib import Path
# use Path
data_path = Path('/home/clay/userdata/BeatlikeMichael/drumVAE-main/groove/drummer1')
# much easier to search for certain data with a certain format
for file in data_path.rglob('*.mid'):