programming-examples/python/Basics/List all files in a directory in Python.py

4 lines
172 B
Python
Raw Normal View History

2019-11-18 14:44:36 +01:00
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);