Path.mkdir()
Path.mkdir() is a Python method in the Pathlib Module category. Creates the directory; with parents=True creates intermediate dirs like mkdir -p. The syntax is Path.mkdir(mode=0o777, parents=False, exist_ok=False). Parameters: mode, parents, exist_ok. Returns: None. A typical example: Path("/tmp/a/b/c").mkdir(parents=True, exist_ok=True). A close sibling is pathlib.Path(), which creates a Path object for filesystem path operations. A close sibling is Path.exists(), which returns True if the path points to an existing file or directory. A close sibling is Path.is_file(), which returns True if the path points to a regular file. A close sibling is Path.is_dir(), which returns True if the path points to a directory. More about this category: Object-oriented filesystem paths — Path operations, glob, file I/O. For a broader walkthrough, read the Pathlib Module guide. Related Pathlib Module entries: pathlib.Path(), Path.exists(), Path.is_file(), Path.is_dir(), Path.read_text(), Path.write_text(). This page is part of the free Python Reference documentation covering 978+ functions, methods, and modules with examples and parameter details.