For Teachers

This page is for planning lessons: what a class can do on the devices it has, what needs a connection, how to give students a program to start from, and what they can and cannot install.

What runs on the student's own device

Python runs on the device the student is holding. A program is not sent anywhere to be run, and there is no session to start or to reconnect.

A class can do thisWeb browseriPad or iPhone appDesktop app
turtle, Pyctures and Pymations with the previewYesYesYes
pandas tables and matplotlib chartsYesYesYes
sympy, scipy and scikit-learnYesYes: see where each library runsYes, once installed with a pip line
A Flask web app with its page beside the codeYesYesYes, with the page in a browser tab
Notebooks (CodeBook)YesYesYes
HTML pages with a live previewYesYesYes
Stopping at a breakpoint in a program that drawsNoYes, with the app's own PythonNo
Terminals, git, project folders, compiled languagesWith a paired computerWith a paired computerYes

The same file gives the same picture on each, so a class with mixed devices can follow one worksheet.

What needs a connection

  • Opening Circuitry and signing in.
  • The first Python run on a device, in a web browser. Python itself is fetched then. The iPhone and iPad app has Python built in.
  • The first time a file imports a library that is not already there, such as sympy or scipy. It is fetched once.
  • A !pip install line, the first time it runs. Later runs skip it.
  • Altair charts, and any page that loads something from the internet.
  • The AI agent and inline suggestions, unless a model on the device or on your own computer is in use.

Once Python and the libraries a lesson uses are there, running programs needs no connection.

Before a lesson: on the network and the devices the class will use, run each program of the lesson once. That fetches everything it needs and shows you what the students will see. If the school's network filters traffic, give Network Requirements to whoever manages it; the address Python is fetched from is listed there.

What needs a computer

Terminals, project folders on a disk, git, building Go, Rust, C, C++ or Zig, and command-line coding agents need the desktop app, or a tablet or phone paired with a computer through Circuit. None of the lessons in Learning to Code needs them.

Handing out starter files

  • Paste from a page. Every code block in this documentation has a copy button. A student makes a Python file ( → Code → Python), pastes, and presses Run. The same works from your own worksheet or class page.
  • Give out a .py file. File → Open File (⌘O) opens one file with no project around it: see Just one file. On iPhone and iPad, files are kept on the device or in iCloud Drive.
  • Give out a notebook. File → Import… turns a Jupyter .ipynb file into a CodeBook. See Import from Other Tools.
  • Show it live. Sharing, Collaboration and Pairing lets a class watch your document on their own screens, or lets you look at a student's.

A new file is not saved anywhere until the student presses Save, which asks where to put it. In a web browser with nowhere to save, Save offers a download. See where your files are.

What students can install

  • Only what a line in their own code asks for. !pip install and a package's name at the top of a file installs it. There is no package window and no terminal on a phone, a tablet or in a browser.
  • In a web browser: packages written purely in Python, and the compiled ones that were built for the Python in the page (numpy, pandas, scipy and many more). Packages last for as long as the page is open.
  • In the iPhone and iPad app: packages written purely in Python. They are kept between launches.
  • In the desktop app: anything pip can install. Packages go into a folder of Circuit's own, and the computer's Python is never changed.

See Installing Python Packages.

Things that differ from Python on a school computer

Worth knowing before you reuse a worksheet:

  • input() does not ask a question. There is no terminal for the student to type an answer into, and in a plain Python file a call such as input("Your name? ") stops with an error. Have students set the value in a variable at the top of the file and change it there.
  • There is no pygame. Use Pyctures for games.
  • turtle has no textinput(), numinput(), undo() or picture (.gif) shapes. Each stops the program with a message that names it. Everything else in a usual first course works: see Turtle.
  • A turtle or Pyctures program that reads the arrow keys needs a keyboard. On tablets without one, use taps: screen.onclick in turtle, mouse in Pyctures.
  • tkinter is not available, so a program that opens its own window does not run.

A first term, as one possible order

  1. turtle: sequence, loops, functions, with a picture for every line.
  2. Pyctures: variables that change over time, if, lists, a game.
  3. Data and science: tables and charts from data the class collected.
  4. Pymations: students explain a piece of maths as an animation.
  5. Building for the web: a page, a form and a server.

How the editor helps you learn is the page to give students who ask what a button does.