Inline Python

I recently came across a post on reddit that joked about being able to include python in a website by using a <python> element. After pondering for a while, i came to the conclusion that actually, it wasnt a completely rediculous idea, and so decided to try and impliment it.

Download Demo

Using a browser implementation of python called Skulpt I was able to write a small piece of code that looked for <python> elements, and then compiled and ran them on page load. I also added the option for custom output divs using a data-attribute.

This code was written for FUN. It is probably not a good idea to use it for anything serious.
Also, Yes, I know about Brython

Here is how you use it

Here is the javascript implementation

Its not the worlds most complex code, but it was a good bit of fun. If you like it, Feel free to donate me a cup of coffee :)

By Calum Knott

Help me buy a Coffee!