The Python exists () function is used to check the existence of a specific file or directory. It is also used to determine if a URL refers to an open file description. It returns the true, for the Boolean value of the file and returns otherwise if false. It is used by os module and sub.mod os.path as os.path.exists (path).