An interactive, REPL-native journey to learn Python by doing.
Inspired by Gameshell, but designed entirely within the Python REPL.
PyQuest is a gamified curriculum that teaches Python from the inside out β through hands-on problem-solving, inside the Python REPL. Each level presents a challenge. When you solve it, you advance. Your progress is saved automatically.
git clone https://github.com/cognitivecomputations/pyquest.git
cd pyquest
python
Inside the REPL:
from game.engine import start_game
start_game()
- Each level is a separate Python file located in
levels/
. - When the level loads, it calls
print_goal()
to display your objective. - You solve the challenge using Python code in the REPL.
- Run
check()
to test your solution. - If correct, you automatically advance to the next level.
- Your progress is saved in
save/player_progress.json
.
pyreplquest/
β
βββ game/ # Core game engine
β βββ engine.py
β βββ state.py
β βββ ...
β
βββ levels/ # One Python file per level
β βββ level01.py
β βββ level02.py
β βββ ...
β
βββ save/ # Stores progress
β βββ player_progress.json
β
βββ main.py # (Optional) Entry point
βββ README.md
Hereβs what a typical level file looks like (levels/level01.py
):
def print_goal():
print("Define a variable `name` with your name as a string.")
def check_complete(state):
return isinstance(state.get("name"), str) and len(state["name"]) > 0
Youβd solve it like this in the REPL:
>>> name = "Ada"
>>> check()
β
Level complete!
PyREPLQuest starts with basic syntax, and gradually builds toward real-world projects like:
- File I/O (text, JSON, CSV)
- Data transformation (ETL)
- Search and sort algorithms
- Visualization with matplotlib
- Simple Flask web apps
- SQLite database operations
All playable entirely from the REPL.
-
Python 3.8+
-
No external dependencies until charting/web levels
-
Install optional libraries for advanced levels:
pip install matplotlib flask requests
- Homeschooling parents or educators
- Kids, teens, or adults learning Python
- REPL lovers
- Fans of Gameshell-style learning
MIT License. Designed to be forked, modified, and shared.