PyLearn Overview

Last Updated 9 hours ago by cneuhaus

PyLearn — Programming and AI Literacy for Young Learners

Students today grow up in two digital worlds that look similar on the surface but work completely differently underneath. In the world of programming, behavior is defined by explicit rules: the computer does exactly what was written, step by step, and every result can be traced back to a concrete cause. In the world of AI, outputs may look convincing and useful, but they are generated as plausible predictions — not as transparent, traceable reasoning.

For beginners, both worlds can feel equally “smart” from the outside, even though they operate on fundamentally different principles. This course exists to make that distinction visible and intellectually usable. The aim is not to teach as much Python syntax as possible, but to help learners understand how digital systems produce behavior, where control lies, and how to judge the reliability of an output.


Why This Approach Is Different

Many current offers either teach coding without addressing AI at all, or introduce AI as a shortcut that bypasses actual understanding. Here, programming and AI are not blended into one vague “digital creativity” topic — they are taught as two separate modes of thinking that students (between 11-14) must learn to compare, evaluate, and use deliberately.

AI is part of the course from early on, but in a controlled progression: first as an explanation tool, then as a source of suggestions, and only later as an agent that can propose concrete code changes. This sequence is intentional. Students need a solid mental model of deterministic code before they can meaningfully evaluate probabilistic AI output. A learner who can write a small program but cannot judge whether AI output is flawed remains dependent on systems they do not understand. A learner who grasps the difference gains something more durable: technical judgment.


Personal note: The software is done, the concept below also.

BUT: Still I have not done the sessions, the concept needs to be proved in real-live 🙂

This will happen the next months. I will keep you posted. If you are interested in trying this out, or if you have any good suggestion, you are more then welcome to contact me.


How a Lesson Works — Four Sessions

The course runs in four focused sessions of roughly 90 minutes each. Each session has a clear theme, and they build on each other — skills and AI tools are introduced in deliberate sequence. Teachers do not need to be Python experts. The platform is designed so the teacher’s role is facilitation and discussion, not live debugging.

Session 1 — Pure Logic, No AI

Students open PyLearn and immediately have a small working program in front of them. The first task is not to write code — it already runs. The task is to predict what it does, run it, and then change it. What happens if you add another name? What if the comparison is wrong? This phase builds a mental model: code is a machine with traceable cause and effect, not a black box.

In the second phase, a deliberate error is introduced and students ask the AI — in Chat mode only — to explain it. The AI explains. The student fixes it. The AI is explicitly not allowed to write the fix. This is the first experience of AI as explainer, not solver — and many students find it frustrating in exactly the right way.

Session 2 — Adventure: Logic Becomes Visible

Session 2 is where motivation spikes. Students see a background image appear, text render over it, and characters move — all triggered by a few lines of pure Python if/else logic. The pylearn library handles the visual layer, so students experience that code creates behavior in a structured and inspectable way: choices have consequences, state changes, and the program responds.

By the end of this session, students use Suggestion mode for the first time: they ask “how do I add a second question?” and receive a hint. They then implement it themselves — the suggestion is a scaffold, not a paste target.

Session 3 — Build From Scratch

Students plan a short adventure story on paper first — Start → Decision 1 → Decision 2 → End — before touching the editor. They then build it independently, without AI assistance. Only in the later phase do they bring in Suggestion mode to compare ideas.

Then Agent mode appears for the first time: the AI proposes a concrete code change, shown as a highlighted diff. Students see exactly which lines would be added or removed. They decide whether to accept. This makes the AI’s intervention visible and deliberate — not a background process that silently rewrites their work.

Session 4 — The Comparison

The final session is the most intellectually demanding. Students solve the same task twice: once on their own, then by asking the AI to do it. They place both solutions side by side and answer concrete questions: Does the AI’s version work? Is it better, or just different? Where does it fail? What did the AI produce that you wouldn’t have — and why?

Students close the session by distinguishing the three AI roles — Chat, Suggestion, Agent — and explaining when each is appropriate. That reflection is the final assessment.

A note for teachers: The progression of AI access across sessions is not arbitrary. Chat-only → Suggestion → Agent follows a ladder of increasing AI involvement, deliberately timed so students have built enough understanding to evaluate what the AI proposes before they are allowed to accept it. Skipping ahead breaks the didactic logic.


Getting Started — For Teachers

PyLearn runs in the browser — no installation needed for students or teachers. The first person to log in via Google automatically becomes the teacher and has full admin access.

  • Create student accounts — go to the Admin Dashboard → Students, create an account, share the PIN with the student
  • Prepare starter programs — write a program in the Programs panel and assign it to students before the lesson
  • Set the AI mode — choose OFF, Chat, Suggest, or Agent for the whole classroom; change it at any point mid-session
  • Monitor students — click any student name in the dashboard to view their current screen live; you can also edit their code directly to support them
  • Activate Cheat Sheets — enable quick-reference cards for students mid-session when they need a syntax reminder
  • Manage AI credits — each AI request costs one credit; reset credits per student to prevent overuse

Getting Started — For Students

Your teacher will give you a login PIN. Open the PyLearn URL in your browser, enter your name and PIN, and you are in — no account registration, no app to install.

  • Open a program — click a file in the Files panel on the left; programs your teacher has assigned appear there automatically
  • Run your code — press the Run button; output appears immediately in the Output panel on the right
  • Use the AI — the AI panel is on the right side; what it can do depends on the mode your teacher has set for the lesson
  • Ask for help — click the “Need Help” button in the status bar; your teacher will be notified and can look at your screen
  • Upload images — for adventure programs, upload your own background images or sprites in the Images tab of the Files panel

Platform Guide

Teacher: Admin Dashboard

The Admin Dashboard is your control centre during a session. From here you manage students, distribute programs and prompts, configure AI behaviour, and monitor every student’s screen in real time.

Teacher admin dashboard overview

Student Management

Create student accounts and share the login PIN. You can pause individual students, reset their AI credit (a credit is spent each time a student uses AI, preventing overuse), and re-activate accounts at any time.

Student management panel

Programs

Write starter programs in advance and assign them to students. When assigned, the program appears in the student’s file list and they work on their own copy — the teacher’s original stays unchanged.

Programs panel

Prompts & Cheat Sheets

Prompts work the same way as programs — write a prompt template and assign it to students to guide their AI interaction for that session. Cheat Sheets are quick-reference cards (Python syntax, commands to remember) that you activate for students mid-session. Once activated, they become visible in the student’s interface.

AI Mode Configuration

This is the most important control for the didactic progression. You set the AI mode for the whole classroom from here, and you can change it at any point during a lesson. Each mode can also have a custom system prompt that is silently added to every student request — so you can, for example, instruct the AI to never give complete solutions.

ModeWhat the AI doesCan it change code?
OFFAI panel hidden — pure programming, no AINo
ChatConversational Q&A, concept explanationsNo
SuggestHints and improvement ideasNo
AgentProposes concrete code changes as a visible diffYes — student must accept
AI configuration panel

Student Workspace

When a student logs in, they see a single page with four areas working together.

Status Bar

  • Connection indicator — green means the student is live and connected to the server
  • Cheat Sheet button — appears when the teacher has activated a cheat sheet for the session
  • Need Help button — sends a help request to the teacher; the teacher can then view and edit the student’s screen directly

Workspace Panels

  • Files / Images — select a Python program to work on (including teacher-assigned starters) and upload images for adventure scenes
  • Code Editor — a full Python editor with syntax highlighting (same editor used in VS Code)
  • Output Window — shows program output, terminal text, graphics, and adventure scenes; can be expanded to full screen
  • AI Assistant — available in Chat, Suggest, or Agent mode as configured by the teacher; in Agent mode, proposed code changes appear as a highlighted diff before the student accepts them
Student workspace overview

PyLearn Python Library — Command Reference

The pylearn library is a single Python module that gives students immediate visual output without any external installation. It supports adventure scenes, sprites, dialogue, text overlays, turtle graphics, and charts — all rendering directly in the output panel.

Quick Command Reference

scene(name)
show_sprite(name, x, y)
show_sprite(name, x, y, size)
move_sprite(name, x, y)
move_sprite(name, x, y, duration)
show_text(id, text, x, y)
show_text(id, text, x, y, size, color, background)
clear_text(id)
clear_text()
say(text)
say(text, color, size, background)
ask(question)
ask(question, color, size)

Parameters Explained

name        # Name of an image or background, without .png or .jpg
id          # Name of a text field, used to update or delete it later
text        # Text to display
question    # Question shown to the player
x           # Position left to right, 0 to 500
y           # Position top to bottom, 0 to 500
size        # Width for sprites, font size for text
duration    # Duration of a movement in seconds
color       # Text colour, e.g. "white", "yellow", "cyan", "green"
background  # Background colour, e.g. "#000000"

Note: Adventure mode and Turtle mode cannot be mixed in the same program. Use either Adventure or Turtle.


Complete Example

from pylearn import scene, show_sprite, move_sprite, show_text, clear_text, say, ask
scene("forest")
show_text("title", "Das Wald-Abenteuer", x=130, y=20, size=28, color="yellow")
show_sprite("hero", x=50, y=300, size=100)
show_sprite("devil", x=350, y=280, size=100)
say("Du wachst in einem dunklen Wald auf.")
say("Vor dir steht ein kleiner Teufel.")
move_sprite("hero", x=180, y=300, duration=1)
answer = ask("Was machst du? kämpfen oder fliehen?")
if answer == "kämpfen":
    say("Du ziehst dein Schwert und stellst dich dem Teufel.")
    show_text("status", "Mut: +10", x=10, y=10, color="green")
else:
    say("Du rennst schnell zurück zum sicheren Dorf.")
    move_sprite("hero", x=30, y=350, duration=1)
    show_text("status", "Sicherheit: +10", x=10, y=10, color="cyan")

Key Rules to Remember

  • scene() sets the background image
  • show_sprite() places a character or object on screen
  • move_sprite() moves a character to a new position
  • show_text() displays text at a fixed position on the scene
  • clear_text() removes a text element (or all of them)
  • say() adds a line to the story dialogue below the scene
  • ask() shows a question and waits for the player’s input

The program does exactly what you tell it. You are the one building the rules of the world.