To knowing if a directory isn't empty, I use: dir_example = "/usr/foo/" if glob.glob(os.path.join(dir_example, "*")): ... But, as it has to expand all files, i'm supposed that it's a little slow to simply knowing if a directory is empty. Any improvement?