list files in os python code example
Example 1: list files in directory python
import os
print(os.listdir('/path/to/folder/to/list'))
Example 2: python get list of files in directory
from os import listdir
file_list = listdir(folder_path)
import os
print(os.listdir('/path/to/folder/to/list'))
from os import listdir
file_list = listdir(folder_path)