from os.path import exists file_exists = exists(path_to_file) #File_exists returns True if file exists otherwise returns False print(file_exists)