Trinket.IO

Interactive Python for the Web

What is a Trinket?

  • A Trinket is an interactive Python script
  • Runs in any web browser using JavaScript
  • Can be embedded in any web page
  • Can be freely shared or remixed
  • Education oriented: "Teach anything with code"
  • Website: http://trinket.io

Pizza Combinations

How many different pizza combinations can be ordered from Domino's Pizza?

Click down arrow for details

Rules:

  1. There are 25 different toppings.
  2. Each topping has five levels: light, normal, extra, double, or triple.
  3. Limit of 10 toppings per pizza.
  4. Cheese does not count as a topping, unless extra cheese is ordered.
  5. Sauce does not count as a topping. There are 13 options for sauce.
  6. There are five kinds of crust.

The solution!

Turtle Graphics!

Interactive HTML

Interactive Music

Interactive courses

  • Can have multiple sections and subsections.
  • Pages can include images, video, markdown, and interactive code.
  • Support for IPython notebooks.
  • Math formulas using MathJax.
  • Example: How to Count

Limitations

  • Based on Skulpt, an in-browser implementation of Python in JavaScript.
  • Skulpt is based on Python 2.6. Newer language features are not available.
  • Most Python libraries are not available in Skulpt.
  • Behavior is not 100% identical to Python.

Thank You!

Trinket

By David Radcliffe

Trinket

  • 1,686