Learning to Code
Circuitry is a full code editor of the kind professionals use, and it is also a place to learn. You write a program on one side and see what it does on the other: a turtle drawing a square, a game, a maths animation, a table and a chart, a web page. Press Run, change a number, press Run again.
Python runs on the device you are holding, so there is nothing to install before the first lesson. The same lessons work in a web browser, in the desktop app, and on an iPad or a phone.
This section is a set of short paths. Each one has a first program to type or paste, what you should see, three things to try changing, and where to go next.
Pick a path
| You are | Start with |
|---|---|
| A child, or anyone writing a first program | First steps: drawing with turtle |
| At school or college, and you want to make pictures and games | Graphics and games with Pyctures |
| Studying maths, or explaining it to someone | Maths animations with Pymations |
| A university student or a scientist with data to look at | Data and science |
| Learning how web sites are made | Building for the web |
| Already a programmer, and used to an editor such as VS Code | How the editor helps you learn |
| A teacher planning lessons | For teachers |
The paths are in order of difficulty, but none depends on the one before it. If you do not know where to start, start with turtle.
The paths
- First steps: drawing with turtle. Turtle is a simple way of programming, used in schools to teach children how to make simple programs. You tell a turtle to move and to turn, and it draws a line wherever it goes. It is Python's own
turtlemodule, so exercises from a book or a worksheet run as they are written. - Graphics and games with Pyctures. A few plain functions (
circle,rect,text) and adraw()that is called every frame. Moving shapes, the keyboard and the mouse, sprites, sound and 3D. - Maths animations with Pymations. Shapes, equations and graphs that appear, move and change into each other, the way they do in maths explainer videos. Scripts written for Manim run too.
- Data and science. pandas tables, charts, exact algebra with sympy, and fitting and statistics with scipy and scikit-learn. One file with its output beside it, or a notebook of cells in a CodeBook.
- Building for the web. A Python web server written with Flask, with the page it serves shown beside the code. HTML and React files have a live preview of their own.
- How the editor helps you learn. Run, the preview, the three views, the output panel, breakpoints, where files are kept, working on an iPad or a phone, and what an AI agent can do alongside you.
- For teachers. What runs on the device and what needs a connection or a computer, how to hand out starter files, and what students can install.
Before the first lesson
- Open Circuitry in a web browser, or install the app. See Installation.
- From the new-document menu, choose Code, then Python, and give the file a name ending in
.py. - Type or paste a program and press Run in the footer.
The first run in a session loads Python, which can take a few seconds. After that, runs start straight away.
Coming from pygame
There is no pygame in Circuitry, so a file that imports pygame does not run in the preview. Use Pyctures for the same kind of program: it has a function that is called every frame, the keyboard and the mouse, sprites and sound.