Python · Errors and files

pathlib.Path

An object-oriented path API that is clearer than string concatenation.

Syntax
from pathlib import Path

Example

Open in the lab

More in this group

assert csv module Custom exception else and finally json module raise try / except with

Learn this in the course

Reference pages are the quick answer. The course explains the why, shows the full example and ends with a challenge.

Open the course