Yes there is, you just need the pathlib library if you want to search inside all the sub directories of a directory for your file, you can use this recursive function (DFS) Code: from pathlib import Path def file_exists(origin,filename): for i in [x for x in Path(origin).iterdir()]: if i.name == filename: return True elif i.is_dir(): t = file_exists(i,filename) return t return False Usage: Code: print(file_exists(/home/user/Documents/,'myhomework.pdf') But if you want to check the existance of a file in the running directory you can use this: Code: from pathlib import Path myfile = 'main.py' print(Path(myfile).exists()) Hope it helps