Use os.path.exists() to check whether file exists or not:
def fileAtLocation(filename,path): return os.path.exists(path + filename)filename="dummy.txt"path = "/home/ie/SachinSaga/scripts/subscription_unit_reader_file/"if fileAtLocation(filename,path): print('file found at location..')else: print('file not found at location..')