Is there a way to return a list of all the subdirectories in the current directory in Python?
I know you can do this with files, but I need to get the list of direct
By joining multiple solutions from here, this is what I ended up using:
import os import glob def list_dirs(path): return [os.path.basename(x) for x in filter( os.path.isdir, glob.glob(os.path.join(path, '*')))]