os.path.normpath()
  • References/Python/Python/File & Directory Access

os.path.normpath(path) Normalize a pathname by collapsing redundant separators and up-level references so that A//B

2025-01-10 15:47:30
pathlib.Path.rglob()
  • References/Python/Python/File & Directory Access

Path.rglob(pattern) This is like calling

2025-01-10 15:47:30
os.path.exists()
  • References/Python/Python/File & Directory Access

os.path.exists(path) Return True if path refers to an existing path or an open file descriptor. Returns

2025-01-10 15:47:30
shutil.copyfile()
  • References/Python/Python/File & Directory Access

shutil.copyfile(src, dst, *, follow_symlinks=True) Copy the contents (no metadata) of the file named src to a file

2025-01-10 15:47:30
shutil.unpack_archive()
  • References/Python/Python/File & Directory Access

shutil.unpack_archive(filename[, extract_dir[, format]]) Unpack an archive. filename is the full path of the archive

2025-01-10 15:47:30
os.path.abspath()
  • References/Python/Python/File & Directory Access

os.path.abspath(path) Return a normalized absolutized version of the pathname path. On most platforms, this is equivalent

2025-01-10 15:47:30
fileinput.isfirstline()
  • References/Python/Python/File & Directory Access

fileinput.isfirstline() Returns true if the line just read is the first line of its file, otherwise returns false.

2025-01-10 15:47:30
os.path.isdir()
  • References/Python/Python/File & Directory Access

os.path.isdir(path) Return True if path is an existing directory. This follows symbolic links, so both

2025-01-10 15:47:30
linecache.checkcache()
  • References/Python/Python/File & Directory Access

linecache.checkcache(filename=None) Check the cache for validity. Use this function if files in the cache may have changed on

2025-01-10 15:47:30
pathlib.Path.unlink()
  • References/Python/Python/File & Directory Access

Path.unlink() Remove this file or symbolic link. If the path points to a directory, use Path.rmdir() instead.

2025-01-10 15:47:30