glob.glob("path/*", recursive = True) code example Example: python glob subdirectories import glob subdirectories = glob.glob("./*/")