Editor

A Trinket alternative for Python

Bring your Python lessons here: turtle, code boxes for your own pages, and classes with live progress. Free.

Where each Trinket feature is

On TrinketHere
Python in the browserThe editor: Python 3 with NumPy, pandas and matplotlib, on Chromebooks and school computers.
Turtle graphicsimport turtle works, with PNG and GIF export. Keyboard and mouse events (onkey, onclick) are not supported yet.
Code boxes on your own pagesPaste your program below and copy one line of HTML. Works on Google Sites, blogs and most course platforms.
Share a program with a linkShare in the editor gives a link that opens your code. Nobody needs an account to open it.
Classes and assignmentsStudents join with a code and you see who has solved what, live. Assign practice problems, challenges, quizzes and tutorials, all checked automatically. Turtle drawings are not checked.
input() in programsWorks in the editor, but not in code boxes embedded on other sites.

Replace a Trinket embed

Paste the program from your old trinket, check it runs, then copy the snippet into your page where the trinket used to be.

Try:
Loading editor…
Theme
px(sized to your code automatically)
Copy this into your page
Using Notion or another embed-by-URL block? Copy the link instead:
Live preview (press Run in it, it works)

Turtle

The same commands as desktop Python. The full list is on Python turtle online.

import turtle
t = turtle.Turtle()
t.shape("turtle")
t.color("purple", "gold")
t.begin_fill()
for _ in range(5):
t.forward(150)
t.right(144)
t.end_fill()
t.penup()
t.goto(-70, -80)
t.write("Hello, turtle!", font=("Arial", 16, "bold"))
turtle.done()
The drawing appears here. Press Run.

Set up a class

  1. Open Classrooms and create a class. You get a six-letter code, a join link and a QR code.
  2. Students join from any browser and sign in with a school email, Google or GitHub.
  3. Assign practice problems, challenges, quizzes and tutorials. Your board shows who has finished and who is stuck.

Questions

Can I import my trinkets?

There is no import: paste each program into the editor or the box on this page. Copies you kept as .py files, in Google Docs or slides, on your learning platform or on GitHub all paste in and run.

Is it free for schools?

Yes. Running code, turtle, code boxes and classes are free, with no limit on students or classes. Students need to sign in only to join a class.

Does it work on Chromebooks and iPads?

Yes, on Chromebooks, Windows, Macs and tablets. On iPads everything runs except input(), which iPad browsers do not support yet.

Does it support HTML, Java or Blockly?

No, only Python.