Python Educator 2.0 lets you load, edit, run, display, and trace Python code in the browser. It is designed for teachers who want to demonstrate algorithms clearly and for students who want to explore code step by step.
Getting started
When the page opens, you can either:
- Paste a raw Python file URL into the box and click Load Code.
- Click Upload .py to load a local Python file from your computer. This also allows
.txt files in case of firewall restrictions.
- Choose one of the ready-made iGCSE algorithm examples.
- Click Blank File to start writing your own Python code.
The ready-made examples include common algorithms such as average, counting, totalling, linear search, bubble sort, if/else, for loops, while loops, and repeat-style loops.
Loading code from a URL
To load code from another source:
- Copy the raw URL of a Python file.
- Paste it into the input box.
- Click Load Code.
The page URL will update automatically, so you can share the loaded version with students.
Example format:
https://jamesabela.github.io/jsfun/pythoncopy?url=RAW_FILE_URL_HERE
How to make a Gist on GitHub
If you don't know how to create a Gist, follow these steps to host your Python code so it can be loaded into Python Educator:
- Go to gist.github.com (you will need a GitHub account).
- Create a new Gist: Give your file a name ending in
.py and type or paste your code.
- Click the green Create secret gist (or public gist) button.
- Get the Raw URL: Click the Raw button in the top right corner of your code block.
- Copy the URL from your browser's address bar. It will start with
https://gist.githubusercontent.com/...
Paste this URL into the input box to load your code!
Edit Mode
Edit Mode is the normal working mode. In Edit Mode, you can:
- edit the Python code
- run the code in the browser
- copy the code
- download the code as a .py file
- download the code as a .txt file
- open the page in full screen
- create a code-ordering puzzle from the current file
Use Edit Mode when students need to type, modify, test, or copy the program.
Running Python code
Click Run to run the code in the browser. The output appears in the panel on the right. If the program uses input(), the browser will ask the user to enter a value. Click Reset to clear the output and reset the runner.
Supported Modules: Only random, math, statistics, datetime, and string are supported in the browser. For any other modules or more complex libraries, please use a local IDE.
Import detection
Python Educator automatically checks whether the code uses imports. If the code uses modules other than the supported ones listed above, the tool will disable the run button and prompt you to download and run the program on a local Python installation.
Display Mode
Display Mode is designed for teaching and explaining code. In Display Mode, the editor becomes a cleaner code display with syntax highlighting. The code cannot be edited directly in this mode.
Display Mode includes: line highlighting, step-by-step execution, automatic play mode, variable tracking, call trace display, input handling, recursion-friendly call tracing. Use Display Mode when explaining how an algorithm works line by line.
Step-by-step tracing
In Display Mode, use these buttons:
| Button | What it does |
| Play | Runs through the trace automatically |
| Pause | Pauses automatic tracing |
| Step | Moves forward one step |
| Back | Moves back one step |
| Reset | Restarts the trace |
As the program runs, the current line is highlighted. The output, variables, and function calls are updated as the code progresses.
Variables & Call Trace panels
The Variables panel shows the current values of variables while the program is being traced. This is useful for explaining: counters, totals, loop variables, list values, function parameters, return values.
The Call Trace panel shows function calls as they happen. This is especially useful for teaching: functions, parameters, return values, recursion, the call stack.
For recursive functions, the tool attempts to show when the function is going deeper, when the base case is reached, and when values are returned.
Input in Display Mode
If the program uses input(), the trace will pause and ask for a value. Type the value into the input box and click Submit, or press Enter. The trace will then continue using that input.
Copying and downloading code
Use Copy to copy the current code to the clipboard, Download .py to save it as a Python file, or Download .txt to save it as a text file. This is useful if students need to paste the code into another editor or submit it elsewhere.
Making a puzzle
Click Make Puzzle to turn the current code into a code-ordering puzzle. This opens the code in the reorder activity: https://jamesabela.github.io/jsfun/reorder.html. This is useful for checking whether students understand the correct sequence of an algorithm.
Copy for Docs
The Copy for Docs button is designed to copy your Python code with full syntax highlighting, line numbers, and proper formatting so it looks perfect when pasted into Microsoft Word or Google Docs.
This is ideal for creating worksheets, assessments, or documentation.
⚠️ IMPORTANT: Do NOT use this button if you intend to paste the code into an IDE (like IDLE, VS Code, or PyCharm). The formatting and line numbers will break the code and cause syntax errors. Use the standard Copy Code button instead.
Display options
The top toolbar includes several display controls:
| Control | Purpose |
| Edit Mode / Display Mode | Switches between editing and teaching views |
| Light / Dark | Changes the page theme |
| Font size slider | Makes the code smaller or larger |
| Full Screen | Shows the tool full screen for teaching |
Teacher use cases
Teachers can use Python Educator 2.0 to: demonstrate standard algorithms, explain code line by line, show how variables change, teach loops, selection, functions, and recursion, create code-ordering puzzles, share code examples using a URL, present Python clearly on a large screen.
Student use cases
Students can use it to: experiment with Python code, run short programs in the browser, trace algorithms step by step, check how variables change, copy or download working examples, practise rearranging code into the correct order.
Important limitations
Python Educator 2.0 runs Python in the browser, so it is best for short teaching examples and algorithm demonstrations. Programs that use unsupported imports, external files, graphics libraries, or complex packages should be downloaded and run in a local Python environment instead.