python how to create a list of folder names in a directory code example Example: get list of folders in directory python import os my_list = os.listdir('My_directory')