8 examples of 'os.path.exists' in Python

Every line of 'os.path.exists' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
116def Exists(path: str) -> bool:
117 return os.path.exists(path)
73def path_exists(path):
74 valid = False
75 if path and os.path.exists(path):
76 valid = True
77 return valid
22def path_exists( path ):
23 if os.path.exists( path ):
24 return (True , "Path:%s exists" % path)
25 else:
26 return (False , "ERROR: Path:%s does not exist" % path)
142def exists(env):
143 for version in versions:
144 if get_winddk_root(env, version) is not None:
145 return True
146 return False
21def exists(name):
22 if os.sep in name:
23 variants = [name]
24 else:
25 variants = [os.path.join(dir, name) for dir in PATH]
26 for path in variants:
27 if os.path.isfile(path) or os.path.isfile(path + exe_suffix):
28 return True
29 return False
262def path_check(path):
263 if os.path.exists(path):
264 return True
265 else:
266 return False
309def checkExists(self):
310 """
311 Checks path for existence of the file, errors if not found.
312 @ In, None
313 @ Out, None
314 """
315 path = os.path.normpath(os.path.join(self.path,self.getFilename()))
316 if not os.path.exists(path):
317 self.raiseAnError(IOError,'File not found:',path)
67def isFileExists(filePath) :
68 return os.path.exists(filePath)

Related snippets