os.path.exists() Syntax in Python
Syntax: os.path.exists(path)
Parameter:
- path: A path-like object representing a file system path. A path-like object is either a string or bytes object representing a path.
Return Type: This method returns a Boolean value of class bool. This method returns True if path exists otherwise returns False.
Python | os.path.exists() method
os.path.exists()
method in Python is used to check whether the specified path exists or not. This method can be also used to check whether the given path refers to an open file descriptor or not.