ID EN
Pathlib

home

Python 3.11

Return a new path object representing the user’s home directory (as returned by os.path.expanduser() with ~ construct). If the home directory can’t be resolved, RuntimeError is raised.

Syntax

PYTHON
classmethod Path.home()

Examples

Example 1
PYTHON
>>> Path.home()
PosixPath('/home/antoine')

See Also

os.path.expanduser() RuntimeError