#!/usr/bin/env bash
# Real demos for P076 "The Python Roadmap for Beginners". Runs on Docker (the Mac's).
# One stock Ubuntu 24.04 container is Ana's laptop at a neighbourhood bakery (lab/Dockerfile: python3 as a fresh
# Ubuntu has it, plus pip, venv, git and the command-not-found helper, installed off camera). Ana types into one real
# interactive bash in a pty (demo_driver.py), which also starts the real Python REPL; each version of her script is
# copied in off camera, like a file saved from an editor. pip downloads openpyxl and pytest from PyPI on camera.
set -euo pipefail
cd "$(dirname "$0")"
P=ce-p076
cleanup() { docker rm -f $P-box >/dev/null 2>&1 || true; }
cleanup
[ -n "${KEEP:-}" ] || trap cleanup EXIT
docker build -q -t $P-box lab >/dev/null
docker run -d --name $P-box --hostname bakery $P-box >/dev/null
sleep 1
python3 demo_driver.py "$P"
python3 shots.py
