from os import listdir, getcwd from os.path import isfile, isdir, islink
def gen_tree(directory): for name in listdir(directory)