Experimental / Smaller Projects portfolio project — independent open-source implementation. This is an original, from-scratch build. It is not affiliated with, and does not contain any code, prompts, data, or business logic from, any employer or client.
An educational tool where users write Python code to control a 2D game character, useful for teaching programming concepts interactively.
Code Editor -> Sandbox Executor -> Game Engine State Update -> Rendered Output + Terminal/Debugger
- Django
- Python (sandboxed execution)
- Pygame or a custom 2D engine
- JavaScript (editor frontend)
- In-browser code editor
- Restricted/sandboxed code execution
- Terminal output panel
- Debugger support
- Live game state visualization
- Django backend for session management
- Phase 1: Sandboxed Python execution environment
- Phase 2: Simple 2D game engine controllable via code API
- Phase 3: Editor, terminal, and debugger UI integration
python-game-code-runner/
├── README.md
├── LICENSE
├── .gitignore
├── pyproject.toml
├── .env.example
├── docker/
├── docs/
│ ├── architecture.md
│ └── evaluation.md
├── src/
├── tests/
├── configs/
├── scripts/
├── notebooks/
├── examples/
├── assets/
└── .github/
└── workflows/
git clone <this-repo-url>
cd python-game-code-runner
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt # or: pip install -e .
cp .env.example .env # fill in API keys / configDocument which public dataset(s) or synthetic data generators are used here. No proprietary, employer-owned, or client-identifiable data is used in this project.
Document the commands used to run training, ingestion, or the main pipeline, e.g.:
# Phase 1: run a submission in the restricted executor
python -m src.main run --file examples/safe_moves.py
python -m src.main run --code "print(sum(range(10)))"
python -m src.main run --file examples/blocked_escape.py # -> rejectedPhase 1 scope: the executor restricts builtins, enforces an import
allow-list, and rejects introspection-based escapes via an AST pre-pass. It
runs in-process and does not yet bound CPU time or memory — an infinite
loop will still hang the caller. Hard limits (subprocess + resource rlimits +
timeout) are Phase 1 issue #2.
Document evaluation metrics and how to reproduce them here (see docs/evaluation.md).
To be filled in as the implementation progresses — screenshots, metrics tables, and sample outputs go here.
If this project exposes an API, document the main endpoints here (or link to
auto-generated OpenAPI docs, e.g. /docs for FastAPI).
docker build -t python-game-code-runner .
docker run -p 8000:8000 python-game-code-runnerpytest tests/- This is a from-scratch, independent recreation built for portfolio purposes.
- Performance numbers, once added, are based on public datasets and are not representative of any production system's real-world results.
- Expand evaluation coverage and add CI-based regression checks.
- Add more configuration presets and deployment targets.
- Track open items as GitHub Issues.
This repository is an independent open-source recreation inspired by the kind of production systems I have worked on professionally. It contains no employer or client source code, prompts, datasets, credentials, architecture diagrams, or business logic. All code, data, and documentation here are original or built on publicly available datasets and open-source tools.
Last updated: 2026-08-18