To check if a file exists in Python, you can use either the os.path module or the pathlib module. With os.path, you call a function to check the file’s path. With pathlib, you use an object-oriented approach. Both methods return true if the file exists, and false if it does not.