#!/usr/bin/env bash
# Real demos for P128 "How to Fix Python ModuleNotFoundError: No Module Named". Made on the Mac (Docker Desktop).
# John keeps his family's recipe site in Python on the family PC: build.py (PyYAML) makes the pages, and his sister
# Jen's tools/thumbs.py (Pillow) makes the photos. One container from a stock Ubuntu 24.04 image (lab/Dockerfile)
# with Ubuntu's own Python 3.12; packages come from PyPI. Every command shown is typed into a real interactive bash
# in a pty, two windows on the same PC (demo_driver.py); every line of output is real.
set -euo pipefail
cd "$(dirname "$0")"
cleanup() { docker rm -f ce-p128-pc >/dev/null 2>&1 || true; }
cleanup
[ -n "${KEEP:-}" ] || trap cleanup EXIT
docker build -q -t ce-p128 lab >/dev/null
docker run -d --name ce-p128-pc --hostname family-pc ce-p128 >/dev/null
python3 demo_driver.py
