list items in directory python os code example
Example 1: get list of folders in directory python
import os
my_list = os.listdir('My_directory')
Example 2: python get list of files in directory
from os import listdir
file_list = listdir(folder_path)