Skip to content

0xm1kr/404skills-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

404skills — Python

A self-contained, fullstack tutorial app for learning Python end-to-end, built for engineers who already know Node/TypeScript and need to be interview-ready for a senior Python role.

The curriculum walks the language from scratch, then layers on OOP, typing, concurrency, memory & performance, senior pitfalls, and the algorithms that show up in coding interviews. Each lesson has a TS comparison where helpful, an editable example, and runs your code for real — not simulated.

The backend uses only the Python standard library (no pip dependencies). Read its source as a second tutorial. The frontend is plain HTML / CSS / vanilla JS with no build step.

┌──────────────────────────────────────────────────────────────────┐
│  Sidebar lessons          │  Lesson description + key takeaways  │
│  Search / progress bar    │                                      │
│                           │  ┌────────────────────────────────┐  │
│   ✓ Welcome & Setup       │  │  Editable Python code          │  │
│   ○ Variables & Types…    │  │  (real python3 on backend)     │  │
│   ○ Classes & OOP         │  └────────────────────────────────┘  │
│   ○ ...                   │  ┌────────────────────────────────┐  │
│                           │  │  Output / stderr / errors      │  │
│                           │  └────────────────────────────────┘  │
└──────────────────────────────────────────────────────────────────┘

Run it

You need Python 3.12+ installed.

python3 main.py
# Python tutorial running at http://localhost:8080

Open http://localhost:8080 in your browser.

Optional flags

python3 main.py -addr :9000      # bind to a different port

Ask AI (optional)

Each lesson has a floating Ask AI button. The server auto-detects which provider to use from your environment, in this priority order: Google → Anthropic → OpenAI.

cp .env.example .env
# edit .env and paste your key
python3 main.py

A .env file in the project root is loaded automatically on startup. Real environment variables always win over .env.

Variable Default Notes
GEMINI_API_KEY none Google Gemini (preferred)
GEMINI_MODEL gemini-2.5-flash
ANTHROPIC_API_KEY none Anthropic Claude
ANTHROPIC_MODEL claude-haiku-4-5
OPENAI_API_KEY none OpenAI
OPENAI_MODEL gpt-4o-mini

Curriculum

70 lessons across 15 sections — zero → interview-ready for a senior Python role. Assumes you already write TypeScript at a senior level.

Foundations

Section Lessons
Basics Welcome & Setup · Coming from TypeScript · Variables · Types · Constants
Control Flow if/for/while · Functions · Decorators · Comprehensions · match · Exceptions intro
OOP & Classes Classes · Inheritance · Dataclasses · Dunder methods · Protocols · Composition
Data Structures Lists · Dicts · Sets/Tuples · collections module · Slicing · Copy vs alias
Errors try/except · Custom exceptions · Context managers · Error design
Concurrency Threading · asyncio basics/advanced · Multiprocessing · Sync primitives · GIL
Tooling & Packages venv/pip · pytest/unittest · Packaging · Ruff/format · Type checking
Standard Library pathlib · json · datetime · logging · itertools/functools
Web Development http.server · urllib client · async HTTP intro · Production HTTP
Ecosystem Frameworks landscape · What Python is great at

Senior / Interview Track

Section Lessons
Typing & Generics Type hints · Generics · Protocols · TypedDict/unions · mypy patterns
Memory & Performance Reference semantics · __slots__ · Profiling
Senior Pitfalls Mutable defaults · Late-binding closures · Class mutable attrs
Interview Algorithms Two pointers · Sliding window · Binary search · Backtracking · DP · Graphs · Heaps · Linked lists · LRU cache
Interview Prep Senior Python interview cheatsheet

Progress is tracked in localStorage. Use Reset progress in the sidebar to clear it.

Project layout

404skills-python/
├── main.py                 # composition root
├── pyproject.toml          # metadata only, no runtime deps
├── cmd/smoke/main.py       # smoke test script
├── python_tut/
│   ├── config/dotenv.py
│   ├── lesson/             # Lesson + catalog + lessons_*.py curriculum
│   ├── runner/             # local (python3) + e2b (managed sandbox)
│   ├── tutor/              # LLM adapters (urllib)
│   └── api/                # ThreadingHTTPServer routes
├── web/                    # frontend (served from disk)
├── Dockerfile
└── .env.example

Code sandbox (Local vs E2B)

Unlike Go (go.dev/play) and Rust (play.rust-lang.org), Python has no official public playground API. For any public deployment, user code must run in a remote sandbox — not inside your Cloud Run container.

This project uses E2B code-interpreter sandboxes (Firecracker microVMs). Sign up for a free account — the hobby tier includes $100 of usage.

RUNNER Backend Use for Safety
local python3 in a temp dir Local dev UNSAFE in public
e2b E2B code-interpreter sandbox Cloud deploys Safe — remote microVM
unset Cloud Run → e2b; else local unless E2B_API_KEY is set Anywhere Safe default on Cloud Run

Local dev

RUNNER=local python3 main.py

Cloud / sandbox runs

export E2B_API_KEY=e2b_...
export RUNNER=e2b
python3 main.py

Optional: E2B_TEMPLATE (default code-interpreter-v1).

The local runner auto-detects python3.13 / python3.12 on your PATH (the curriculum targets 3.12+). Override with PYTHON_BIN=/path/to/python3.12.

Smoke test

With the server running:

python3 cmd/smoke/main.py
python3 cmd/smoke/main.py --base http://localhost:8080 --only my-lesson-id

Deploy to Google Cloud Run

gcloud run deploy python-tut \
  --source . \
  --region us-central1 \
  --allow-unauthenticated \
  --update-secrets=E2B_API_KEY=e2b-key:latest,GEMINI_API_KEY=gemini-key:latest \
  --set-env-vars=RUNNER=e2b

The Dockerfile defaults to RUNNER=e2b. Pass E2B_API_KEY via Cloud Run secrets (get a key at https://e2b.dev/dashboard).

Manual Docker workflow (local)

docker build -t python-tut .
docker run --rm -p 8080:8080 \
  -e RUNNER=local \
  -e GEMINI_API_KEY=... \
  python-tut

The image runs as non-root (appuser). Use -e E2B_API_KEY=... when testing the E2B runner locally.

License

MIT © 2026 0xm1kr

About

Python from zero to senior interview ready

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors