Python Pathlib


Path

The Path class is instantiated like:

from pathlib import Path
p = Path('.')


Absolute


Anchor


As_Posix


As_Uri


ChMod


Drive


Exists


ExpandUser


Glob


Group



Is_Absolute


Is_Block_Device


Is_Char_Device


Is_Dir


Is_Fifo


Is_File


Is_Mount


Is_Relative_To


Is_Reserved


Is_Socket



IterDir


JoinPath


Match


MkDir

from pathlib import Path
p = Path('.')

t = p.joinpath('temp')
t.mkdir(parents=False, exist_ok=True)


Name


Open


Owner


Parent


Parents


Parts


Read_Bytes


Read_Text



Relative_To


Rename


Replace


Resolve


RGlob


RmDir


Root


SameFile


Stat


Stem


Suffix


Suffixes



Touch



With_Name


With_Stem


With_Suffix


Write_Bytes


Write_Text


Cwd

A Path class method.

from pathlib import Path
c = Path.cwd()


Home

A Path class method.

from pathlib import Path
h = Path.home()


See also

Python pathlib module documentation


CategoryRicottone