Write a Python program to list all files in a directory.
1 2 3 4 |
from os import listdir from os.path import isfile, join files_list = [f for f in listdir('/home/students') if isfile(join('/home/students', f))] print(files_list); |
1 2 3 4 |
from os import listdir from os.path import isfile, join files_list = [f for f in listdir('/home/students') if isfile(join('/home/students', f))] print(files_list); |