Answers for "get list of only directories python"

18

get list of folders in directory python

import os 
my_list = os.listdir('My_directory')
Posted by: Guest on June-08-2020
2

list only directories

# List directories under the current working directory.
ls -l | grep "^d"

# List directories under the current working directory and 
# include hidden folders
ls -la | grep "^d"
Posted by: Guest on October-09-2020

Code answers related to "get list of only directories python"

Python Answers by Framework

Browse Popular Code Answers by Language