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
os
.
listdir
(
path
=
'.'
)
Examples
Python 3.13
>>
>
import
os
>>
>
os
.
listdir
(
'/home/user'
)
[
'file1.txt'
,
'file2.txt'
]