Course
Simulator
More
Premium
Log in
Python Function Reference
Functions
os.path.exists
os.path.exists
Return True if path refers to an existing path or an open file descriptor.
Python 3.13
os
.
path
.
exists
(
path
)
Examples
Python 3.13
>>
>
import
os
>>
>
os
.
path
.
exists
(
'/home/user/file.txt'
)
True