Use Python's stdlib pathlib module to read, write, append, rename, delete, and search files on disk ā then combine those primitives into a DevOps script that reads a deploy config file and writes a timestamped run log.
Create a dedicated directory for this lesson and confirm the virtual environment is active. `pathlib` is part of the Python standard library ā no pip install needed.
mkdir -p ~/devops-python/lesson-201cd ~/devops-python/lesson-201source ~/devops-python/lesson-101/devops-env/bin/activatepython3 -c "from pathlib import Path; print('pathlib OK:', Path.cwd())"pathlib was added to the Python standard library in Python 3.4 and is the recommended way to work with file paths in modern Python.
It replaces the older os.path string-manipulation approach with an object-oriented API where a Path object represents a file or directory location and carries methods for reading, writing, and inspecting it.
Because it is part of the standard library, there is nothing to install.
Your terminal prompt shows (devops-env).
The one-liner prints pathlib OK: followed by the full path to your lesson-201 directory, for example pathlib OK: /Users/yourname/devops-python/lesson-201.