i'm using this code to get all files in a given folder. Is there a way to get only the folders ?
a = os.listdir('Tools')
import os.path dirs = [d for d in os.listdir('Tools') if os.path.isdir(os.path.join('Tools', d))]
2.1m questions
2.1m answers
60 comments
57.0k users