Free Python Editor

Embed runnable Python in Google Sites, Canvas or a blog

Write the code, press "Share or embed", and paste the iframe into your page. Students run and edit the code right there. A replacement for trinket.io/embed/python3 embeds. Not affiliated with Trinket.

Tab indents. Press Esc then Tab to leave the editor. Ctrl+Enter runs.


      

Press Run.

Google Sites

  1. Press "Share or embed" above and copy the embed code.
  2. In Google Sites, open Insert on the right, then Embed.
  3. Choose "Embed code", paste, press Next, then Insert.
  4. Publish your site.

You can also paste the embed URL into the Embed box instead of the code.

Canvas, WordPress and other sites

Paste the embed code wherever the site accepts HTML. In Canvas that is the HTML editor view of a page. In WordPress, use a Custom HTML block. Some schools restrict iframes in Canvas. If the embed doesn't show, link to the code instead.

Replacing an old Trinket embed

An old embed looks like <iframe src="https://trinket.io/embed/python3/…">. Paste the program's code here, press "Share or embed", and replace the whole old iframe with the new one. If you no longer have the code, check the lesson's handouts or a student's copy.

What students see

The embed shows the code, Run and Stop, the output and the turtle drawing. Their edits stay in that frame's address and are never sent to us, and the embed never reads anything saved by this site. Each program runs in its own sandboxed frame inside the embed, with no access to the page around it or to anything this site saves in the browser. "Open in full editor" opens their current code in a new tab.

Try it: the box below is the embed, loading the loop example.

Google Sites steps last checked 2026-10-18 on Google's help page Add a map, video, or other content. Google notes that some websites won't let you add their content.

FAQ

How tall should the iframe be?

At 560 pixels tall the embed shows about 20 lines of code beside the output when the frame is at least 560 pixels wide. On narrower frames the output moves under the code. For turtle drawings, try 800 so the drawing has room.

Does the embed need students to log in?

No. There are no accounts. The code lives in the embed link.

Can I update an embedded program later?

Each link holds one version of the code. To change it, edit the code here, press Share again and replace the embed.

Is it the same as trinket.io/embed/python3?

No. It is a separate free tool, not affiliated with Trinket, that does the same job for Python 3 and turtle lessons.

Pro for teachers: classes

Make a class and assign exercises with one link. Students open it, write their code and press Submit with just a name you choose for them. No student accounts and no student emails. You see every student's code and output in one list, and can run any of them.

This is an early project. Leave your email and we'll write only about the Pro version.

More pages

Python editorTurtle onlineTrinket alternativeFor kids