Skip to content

Commit 631bf31

Browse files
travisjneumanclaude
andcommitted
refactor: split setup guide into platform-specific sub-pages
The 374-line monolithic setup doc is now a platform selector that routes to Windows, macOS, and Linux sub-pages, each under 200 lines with complete standalone instructions. Mobile (Android/iOS) guidance remains in the parent file. All CI checks (root doc contract, navigation chain, link validation) continue to pass. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 159f6b9 commit 631bf31

File tree

4 files changed

+574
-299
lines changed

4 files changed

+574
-299
lines changed

03_SETUP_ALL_PLATFORMS.md

Lines changed: 20 additions & 299 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# 03 - Setup on Any Platform (Windows, macOS, Linux, Android, iOS)
1+
# 03 - Setting Up Python
22
Home: [README](./README.md)
33

44
## Who this is for
55
- Absolute beginners with zero coding experience.
6-
- Learners using Windows, macOS, Linux, Android, or iOS.
6+
- Learners using Windows, macOS, or Linux.
77
- Learners who want exact copy/paste setup steps and expected results.
88

99
## What you will build
1010
- A working Python workspace.
11-
- A virtual environment (`.venv`) on desktop platforms.
11+
- A virtual environment (`.venv`).
1212
- A first script and a first passing test.
1313
- Safe credential habits for SQL-auth workflows.
1414

@@ -20,287 +20,31 @@ Home: [README](./README.md)
2020

2121
## Step-by-step lab pack
2222

23-
### Step 0 - Choose your setup path
24-
Use one of these paths:
25-
- Path A (recommended): Windows, macOS, or Linux desktop/laptop.
26-
- Path B (mobile companion): Android or iOS.
23+
### Choose your platform
2724

28-
Important:
29-
- You can learn basics on mobile.
30-
- For advanced work (drivers, ETL jobs, dashboards, CI), desktop is required.
25+
| Platform | Guide |
26+
|----------|-------|
27+
| **Windows** | [Windows Setup](./03_SETUP_WINDOWS.md) |
28+
| **macOS** | [macOS Setup](./03_SETUP_MACOS.md) |
29+
| **Linux** | [Linux Setup](./03_SETUP_LINUX.md) |
3130

32-
### Step 1 - Install Python
31+
Each guide walks you through the complete setup: installing Python, choosing an editor, creating a project folder, setting up a virtual environment, running your first script, and running your first test.
3332

34-
We recommend **Python 3.13+** for the best experience. Python 3.13 has dramatically better error messages that explain what went wrong in plain English, making debugging much easier for beginners.
33+
### Mobile learners (Android/iOS)
3534

36-
#### Windows 11
37-
1. Download Python from [Python releases for Windows](https://www.python.org/downloads/windows/).
38-
2. Run installer.
39-
3. Check `Add Python to PATH`.
40-
4. Click `Install Now`.
35+
Mobile devices are fine for early fundamentals but you will need a desktop or laptop for advanced work (drivers, ETL jobs, dashboards, CI).
4136

42-
PowerShell verification:
43-
```powershell
44-
python --version
45-
python -c "print('hello from python')"
46-
```
37+
**Android (Termux):**
38+
Install [Termux](https://termux.dev/en/), then run `pkg install -y python` and follow the Linux guide — most commands are identical.
4739

48-
Expected output:
49-
- `Python 3.x.x`
50-
- `hello from python`
51-
52-
#### macOS
53-
Option 1 (python.org installer):
54-
1. Download from [Python releases for macOS](https://www.python.org/downloads/macos/).
55-
2. Run installer package.
56-
57-
Option 2 (Homebrew, if installed):
58-
```bash
59-
brew install python
60-
```
61-
62-
Terminal verification:
63-
```bash
64-
python3 --version
65-
python3 -c "print('hello from python')"
66-
```
67-
68-
Expected output:
69-
- `Python 3.x.x`
70-
- `hello from python`
71-
72-
#### Linux (Ubuntu/Debian example)
73-
```bash
74-
sudo apt update
75-
sudo apt install -y python3 python3-venv python3-pip
76-
python3 --version
77-
python3 -c "print('hello from python')"
78-
```
79-
80-
Expected output:
81-
- `Python 3.x.x`
82-
- `hello from python`
83-
84-
#### Android (mobile companion)
85-
Recommended: [Termux](https://termux.dev/en/).
86-
```bash
87-
pkg update -y
88-
pkg upgrade -y
89-
pkg install -y python
90-
python --version
91-
python -c "print('hello from python')"
92-
```
93-
94-
Expected output:
95-
- `Python 3.x.x`
96-
- `hello from python`
97-
98-
#### iOS (mobile companion)
99-
Use a Python app such as [Pyto](https://pyto.app/) or [Pythonista](https://www.omz-software.com/pythonista/).
100-
1. Install app from App Store.
101-
2. Open app console.
102-
3. Run:
103-
```python
104-
print("hello from python")
105-
```
106-
107-
Expected output:
108-
- `hello from python`
109-
110-
### Step 2 - Install editor and tooling
111-
112-
#### Desktop (Windows/macOS/Linux)
113-
114-
**Option A (recommended): VS Code**
115-
116-
Install VS Code, then add these extensions:
117-
- [Python extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python)
118-
- [Pylance](https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-pylance)
119-
- [Black Formatter](https://marketplace.visualstudio.com/items?itemName=ms-python.black-formatter)
120-
- [Ruff](https://marketplace.visualstudio.com/items?itemName=charliermarsh.ruff)
121-
122-
**Option B (absolute beginners): Thonny**
123-
124-
[Thonny](https://thonny.org/) is a Python IDE designed specifically for beginners. It comes with Python built in (no separate install needed), has a simple interface, and includes a debugger that lets you step through code line by line. If VS Code feels overwhelming, start with Thonny and switch to VS Code later.
125-
126-
#### Mobile (Android/iOS)
127-
- Use built-in editor in your Python app.
128-
- Optional: pair with a Bluetooth keyboard.
129-
- Mobile is acceptable for early labs, but switch to desktop by SQL/automation phases.
130-
131-
### Step 3 - Create your base learning folder
132-
133-
#### Windows PowerShell
134-
```powershell
135-
mkdir $HOME\Documents\python_sme
136-
mkdir $HOME\Documents\python_sme\projects
137-
mkdir $HOME\Documents\python_sme\templates
138-
mkdir $HOME\Documents\python_sme\notes
139-
```
140-
141-
#### macOS/Linux
142-
```bash
143-
mkdir -p "$HOME/python_sme/projects" "$HOME/python_sme/templates" "$HOME/python_sme/notes"
144-
```
145-
146-
#### Android (Termux)
147-
```bash
148-
mkdir -p "$HOME/python_sme/projects" "$HOME/python_sme/templates" "$HOME/python_sme/notes"
149-
```
150-
151-
#### iOS
152-
- Create a `python_sme` folder in your Python app workspace.
153-
- Create subfolders: `projects`, `templates`, `notes`.
154-
155-
### Step 3.5 - Install uv (recommended package manager)
156-
157-
**uv** is a modern, fast replacement for pip and venv. It is used throughout this curriculum.
158-
159-
#### Windows PowerShell
160-
```powershell
161-
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
162-
uv --version
163-
```
164-
165-
#### macOS/Linux
166-
```bash
167-
curl -LsSf https://astral.sh/uv/install.sh | sh
168-
uv --version
169-
```
170-
171-
#### Android (Termux)
172-
```bash
173-
pip install uv
174-
uv --version
175-
```
176-
177-
Expected output:
178-
- `uv x.x.x` (version number)
179-
180-
> **If you prefer pip:** All `uv` commands in this curriculum have pip equivalents. Replace `uv venv` with `python -m venv .venv` and `uv pip install` with `pip install`. Everything else stays the same.
181-
182-
### Step 4 - Create first project and virtual environment
183-
184-
#### Windows PowerShell
185-
```powershell
186-
cd $HOME\Documents\python_sme\projects
187-
mkdir hello_sme
188-
cd hello_sme
189-
uv venv
190-
.\.venv\Scripts\Activate.ps1
191-
python --version
192-
```
193-
194-
Expected output:
195-
- Prompt starts with `(.venv)`.
196-
- Python version prints.
197-
198-
> **pip fallback:** Replace `uv venv` with `python -m venv .venv`.
199-
200-
#### macOS/Linux
201-
```bash
202-
cd "$HOME/python_sme/projects"
203-
mkdir -p hello_sme
204-
cd hello_sme
205-
uv venv
206-
source .venv/bin/activate
207-
python --version
208-
```
209-
210-
Expected output:
211-
- Prompt starts with `(.venv)`.
212-
- Python version prints.
213-
214-
> **pip fallback:** Replace `uv venv` with `python3 -m venv .venv`.
215-
216-
#### Android (Termux)
217-
```bash
218-
cd "$HOME/python_sme/projects"
219-
mkdir -p hello_sme
220-
cd hello_sme
221-
uv venv
222-
source .venv/bin/activate
223-
python --version
224-
```
225-
226-
Expected output:
227-
- Prompt starts with `(.venv)` if your shell prompt supports it.
228-
- Python version prints.
229-
230-
> **pip fallback:** Replace `uv venv` with `python -m venv .venv`.
231-
232-
#### iOS
233-
- Some iOS Python apps do not support full `venv` behavior.
234-
- Use a project folder and keep dependencies minimal in early labs.
235-
- Mark iOS path as "learning-only" and move to desktop before enterprise phases.
236-
237-
### Step 5 - Install pytest and run sanity checks
238-
239-
Desktop and Android:
240-
```bash
241-
uv pip install pytest
242-
pytest --version
243-
```
244-
245-
Windows note: same commands work inside activated PowerShell venv.
246-
247-
> **pip fallback:** Replace `uv pip install pytest` with `python -m pip install pytest`.
248-
249-
Expected output:
250-
- pytest version is displayed.
251-
252-
### Step 6 - Create first script and first test
253-
Create `hello.py`:
254-
```python
255-
print("Hello, Future Python SME")
256-
```
257-
258-
Create `test_hello.py`:
259-
```python
260-
def test_math_baseline():
261-
assert 1 + 1 == 2
262-
```
263-
264-
Run:
265-
```bash
266-
python hello.py
267-
pytest -q
268-
```
269-
270-
Expected output:
271-
- `Hello, Future Python SME`
272-
- `1 passed` (or equivalent pytest success line)
273-
274-
### Step 7 - Corporate-safe credential handling starter rules
275-
Do not embed database credentials in scripts.
276-
277-
Use environment variables:
278-
279-
Windows PowerShell:
280-
```powershell
281-
setx APP_DB_HOST "your-sql-host"
282-
setx APP_DB_NAME "your_db"
283-
setx APP_DB_USER "your_sql_login"
284-
```
285-
286-
macOS/Linux/Android shell:
287-
```bash
288-
export APP_DB_HOST="your-sql-host"
289-
export APP_DB_NAME="your_db"
290-
export APP_DB_USER="your_sql_login"
291-
```
292-
293-
Secret handling rules:
294-
- Keep passwords/tokens out of source code.
295-
- Keep `.env` and secret files in `.gitignore`.
296-
- Prefer approved enterprise secret storage when available.
297-
- Use least privilege and read-only creds first.
40+
**iOS:**
41+
Use a Python app such as [Pyto](https://pyto.app/) or [Pythonista](https://www.omz-software.com/pythonista/). These apps have built-in editors and consoles. Virtual environments are not fully supported on iOS — treat it as a learning-only path and transition to desktop before enterprise phases.
29842

29943
## Expected output
30044
- A working `hello_sme` project with:
30145
- `hello.py`
30246
- `test_hello.py`
303-
- `.venv` (desktop/Android)
47+
- `.venv`
30448
- `python hello.py` succeeds.
30549
- `pytest -q` succeeds.
30650
- You can explain your credential safety rules.
@@ -313,36 +57,13 @@ Secret handling rules:
31357
5. Add a fake credential directly in code, then remove it and replace with env var access.
31458

31559
## Troubleshooting
316-
- `python` or `python3` not found:
317-
- Reopen terminal.
318-
- Confirm install finished.
319-
- Reinstall and ensure PATH/shell setup.
320-
- Windows `Activate.ps1` blocked:
321-
- Run:
322-
```powershell
323-
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
324-
```
325-
- `uv` not found:
326-
- Re-run the install command from Step 3.5.
327-
- Or fall back to pip: replace `uv pip install` with `pip install` and `uv venv` with `python -m venv .venv`.
328-
- `pytest` not found:
329-
- Confirm venv is active.
330-
- Run `uv pip install pytest` (or `pip install pytest`).
331-
- macOS shows old system Python:
332-
- Use `python3` for install and venv creation.
333-
- Linux missing `venv` module:
334-
- Install OS package `python3-venv`.
335-
- Android package build failures:
336-
- Keep to pure-Python packages early.
337-
- Move heavy data/driver work to desktop.
338-
- iOS package limitations:
339-
- Treat iOS as fundamentals-only path.
340-
- Transition to desktop before SQL driver and deployment phases.
60+
- `python` or `python3` not found: reopen terminal, confirm install finished, reinstall and ensure PATH/shell setup.
61+
- See platform-specific troubleshooting in each guide: [Windows](./03_SETUP_WINDOWS.md#troubleshooting) | [macOS](./03_SETUP_MACOS.md#troubleshooting) | [Linux](./03_SETUP_LINUX.md#troubleshooting)
34162

34263
## Mastery check
34364
You pass setup when you can:
34465
- set up a fresh folder from scratch,
345-
- create and activate an isolated environment (or equivalent on mobile),
66+
- create and activate an isolated environment,
34667
- run one script and one test,
34768
- explain why credentials must not be hardcoded.
34869

0 commit comments

Comments
 (0)