# Pathlib
{id: pathlib}

## Pathlib example
{id: pathlib-example}
{i: Path}

* [pathlib](https://docs.python.org/library/pathlib.html)

![](examples/pathlib/path_lib.py)

## Pathlib cwd
{id: pathlib-cwd}
{i: cwd}

![](examples/pathlib/path_lib_cwd.py)


## Pathlib get extension (suffix)
{id: pathlib-extension}
{i: suffix}

![](examples/pathlib/path_lib_extension.py)


## Pathlib current file
{id: pathlib-current-file}
{i: __file__}

![](examples/pathlib/path_lib_current_file.py)

## Pathlib parents (dirname)
{id: pathlib-parents}
{i: parent}
{i: patents}
{i: dirname}

![](examples/pathlib/path_lib_parents.py)

## Pathlib parts (basename)
{id: pathlib-parts}
{i: basename}
{i: parts}

![](examples/pathlib/path_lib_basename.py)

## Pathlib exists
{id: pathlib-exists}
{i: exists}

![](examples/pathlib/path_lib_exists.py)

## Pathlib iterdir (flat)
{id: pathlib-iterdir}
{i: iterdir}

* Iterate over the things (file names, folder names, etc.) in a folder.

![](examples/pathlib/path_lib_iterdir.py)


## Pathlib mkdir (makedir)
{id: pathlib-mkdir}
{i: mkdir}
{i: makedir}

![](examples/pathlib/path_lib_mkdir.py)


![](examples/pathlib/path_lib_joinpath.py)
