Mathematical animations in pure Python — zero dependencies, one file, stdlib only.
No pygame. No numpy. No shaders. Just tkinter, math, and ideas that are older than computers: fiber bundles, chaotic attractors, hyperbolic geometry, n-body gravity. If you have Python, you already have everything this needs.
python spectral_geometry.py # windowed art / ambient display
python spectral_geometry.py --selftest # headless render test, no screen neededControls: Space / → / mouse click — next scene · ← — previous · Esc / Q — quit. Scenes auto-rotate every 7 minutes. Live clock + optional system telemetry (CPU/RAM, if psutil is present) make it a pleasant second-monitor ambient panel.
An interactive artificial ecology in the same dark, luminous canvas style. One standalone Python file; no pip dependencies, no server, no network. Adjust finite resources, replenishment, replication cost, mutation, competition and decision rules. Watch three lineages compete, inspect an agent's reasoning, then compare repeated seeded trials.
python self_replicator.py
python self_replicator.py --selftest
python self_replicator.py --headless --steps 600 --trials 5 --output experiment.jsonWorld shows agents, resource patches and population/resource trajectories. Mechanisms draws eight visual explanations: architecture, finite energy, replication, mutation, competition, self-modification, evolution and pre-mind decision logic. Diagrams use observed events when available and label illustrative examples. Compare reports means, observed ranges and survival across multiple seeds.
Controls: Space — pause/play · N — one tick · R — apply settings and restart · click a hexagon — inspect · ← / → — mechanism diagram · Esc — cancel comparison. Sidebar changes are pending until New run; comparisons use the current sidebar settings. JSON retains trial settings/results; CSV exports the live trajectory.
Python ≥ 3.10; the desktop interface uses tkinter (some Linux Python installations supply it as an OS package). Headless mode and selftests work without Tk. Model, visual guide and reproducible experiments →
Because constraints are the art. Every scene here is:
- One file, no installs — runs on any Python ≥ 3.10 with tkinter (the default on Windows/macOS, one package away on Linux)
- A pooled-canvas renderer — pre-allocated line items, style caching, quantized HSV: thousands of segments at 30 fps on an office laptop
- Honest mathematics — real Verlet gravity, real RK4 pendulums, real Möbius maps and stereographic projections; nothing is a pre-baked path
spectral_geometry.py # the current piece: 8 scenes, windowed, selftest
self_replicator.py # interactive ecology, visual explanations, comparisons
docs/self_replicator.md # model assumptions, controls, experiments
tests/ # model regressions and optional native Tk smoke tests
series/ # the evolution: 01→09, fullscreen tkinter experiments
assets/ # GIF/poster previews + the headless renderer that made them
The series/ folder is the archaeology — nine earlier screensavers (sacred geometry, 4D polytopes, walking creatures, wireframe terrain…) that led here. assets/render_previews.py re-renders every preview headlessly (Pillow used only for asset generation, never at runtime).
MIT — take it, remix it, put it on the second monitor of your open-space office.








