Open the file pointed to by this path and return a file object, as the built-in open() function does.
>>> p = Path('setup.py') >>> with p.open() as f: ... f.readline() ... '#!/usr/bin/env python3\n'
pathlib/Path.open
Path.open