Answers for "get list of folders in directory python"

14

get list of folders in directory python

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

list files in directory python

import os
print(os.listdir('/path/to/folder/to/list'))
Posted by: Guest on April-22-2020
2

get list file in folder python

lstJson = [f for f in os.listdir(str(self.pathJson)) if f.endswith('.json')]
        return lstJson
Posted by: Guest on March-28-2021
0

python get list of files in directory

from os import listdir
file_list = listdir(folder_path)
Posted by: Guest on January-20-2021
1

how to get all folders on path in python

os.walk(directory)
[x[0] for x in os.walk(directory)]
Posted by: Guest on February-10-2020

Code answers related to "get list of folders in directory python"

Python Answers by Framework

Browse Popular Code Answers by Language