Course
Simulator
More
Premium
Log in
Python Function Reference
Functions
os.listdir
os.listdir
Return a list containing the names of the entries in the directory given by path.
Python 3.13
1
os
.
listdir
(
path
=
'.'
)
Examples
Python 3.13
1
2
import
os os
.
listdir
(
'/home/user'
)
['file1.txt', 'file2.txt']