import os def get_domains(): domains = [] for root, dirs, files in os.walk("data"): for dir in dirs: domains.append(dir) return domains