You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

11 line
293 B

  1. import os
  2. import os.path
  3. def cs_path_exists(fspath):
  4. if not os.path.exists(fspath):
  5. return False
  6. # make absolute so we always have a directory
  7. abspath = os.path.abspath(fspath)
  8. directory, filename = os.path.split(abspath)
  9. return filename in os.listdir(directory)