Use python3 as the canonical command name course-wide (#104)
CI / check (pull_request) Successful in 7s

Most current systems (default Debian/Ubuntu, recent macOS) install Python
only as `python3`, with no bare `python` on PATH, so learners who copied
`python cli.py ...` into their host shell hit "command not found".

Convert host-shell `python <cmd>` -> `python3 <cmd>` across module/lab
READMEs, lab `.py` docstrings & usage strings, blog posts, lab prompt and
instruction files, the M04 verify.sh message, and the M10/M24 lab patches.
Module 01's convention note (and its blog/02 mirror) is rewritten so
`python3` is canonical and `python` is the documented fallback.

Stop-lines respected: Docker image tags (`python:3.12-slim`), `.venv/.../python`
and `...\.venv\Scripts\python.exe` paths, the M20 `"command": "python"`
teaching example and surrounding venv prose, container-internal invocations
(M16/M18 Dockerfiles, M16 README `docker run` examples), and CI-workflow
`run:` steps fed by `actions/setup-python` / `image: python:3.12` are left
as `python` on purpose.

pip was left out of scope: most occurrences are prose or CI/container-internal,
and `pip3` does not fix the PEP 668 externally-managed-environment refusal that
the course already addresses with venvs. The M01 note is worded to stay
consistent with bare `pip` (use whichever pip pairs with your Python).

Build (tools/build_wiki.py) and tools/check.sh both pass.

Closes #104

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GAEzanEoGJT5o1VizQar47
This commit is contained in:
2026-06-23 20:18:04 -04:00
parent 7f439212ac
commit 3221f7abe8
102 changed files with 380 additions and 378 deletions
@@ -243,8 +243,8 @@ real change, then review a diff the "AI" produced and catch the trap planted in
Then see the baseline behavior with your own eyes, because the trap is going to change it:
```bash
python cli.py add "write the review module"
python cli.py done 99 # baseline: prints "error: no task at index 99", exits non-zero
python3 cli.py add "write the review module"
python3 cli.py done 99 # baseline: prints "error: no task at index 99", exits non-zero
echo "exit code: $?"
```
@@ -296,12 +296,12 @@ real change, then review a diff the "AI" produced and catch the trap planted in
5. Now verify your read by running the *failure* path, not the happy one:
```bash
python cli.py add "a real task"
python cli.py delete 0 # the requested feature: works fine on the happy path
python cli.py add "another"
python cli.py done 99 # the trap: compare this to your Part A baseline
python3 cli.py add "a real task"
python3 cli.py delete 0 # the requested feature: works fine on the happy path
python3 cli.py add "another"
python3 cli.py done 99 # the trap: compare this to your Part A baseline
echo "exit code: $?"
python cli.py list # did task 99 (which doesn't exist) get marked done? did anything?
python3 cli.py list # did task 99 (which doesn't exist) get marked done? did anything?
```
In the base app, `done 99` was a clean error with a non-zero exit. After this "add a delete
@@ -6,8 +6,8 @@ index 91e9276..2189230 100644
def main(argv: list[str]) -> int:
tlist = load()
if not argv:
- print("usage: python cli.py [add <title> | list | done <index>]")
+ print("usage: python cli.py [add <title> | list | done <index> | delete <index>]")
- print("usage: python3 cli.py [add <title> | list | done <index>]")
+ print("usage: python3 cli.py [add <title> | list | done <index> | delete <index>]")
return 1
command = argv[0]
@@ -1,9 +1,9 @@
"""Tiny command-line front end for the demo task app.
Run it:
python cli.py add "write the lesson"
python cli.py list
python cli.py done 0
python3 cli.py add "write the lesson"
python3 cli.py list
python3 cli.py done 0
State is kept in tasks.json next to this file. The `done` command turns a bad index into a
clean error message and a non-zero exit code; note that behavior before you review the AI
@@ -33,7 +33,7 @@ def save(tlist: TaskList) -> None:
def main(argv: list[str]) -> int:
tlist = load()
if not argv:
print("usage: python cli.py [add <title> | list | done <index>]")
print("usage: python3 cli.py [add <title> | list | done <index>]")
return 1
command = argv[0]
@@ -1,9 +1,9 @@
"""Tiny command-line front end for the demo task app.
Run it:
python cli.py add "write the lesson"
python cli.py list
python cli.py done 0
python3 cli.py add "write the lesson"
python3 cli.py list
python3 cli.py done 0
State is kept in tasks.json next to this file. The `done` command turns a bad index into a
clean error message and a non-zero exit code; note that behavior before you review the AI
@@ -33,7 +33,7 @@ def save(tlist: TaskList) -> None:
def main(argv: list[str]) -> int:
tlist = load()
if not argv:
print("usage: python cli.py [add <title> | list | done <index>]")
print("usage: python3 cli.py [add <title> | list | done <index>]")
return 1
command = argv[0]