Last Updated:

A full-fledged Python interpreter in your browser

I found a very interesting thing. Brython is a Python interpreter written in JavaScript.

The project is positioned as a replacement for native JS in the browser. On the main page of the program website there is an example of analog clocks that work on a python.

 

Analog Clock

 

Scripts are connected to the page using the . It supports working with the DOM object and some specific functions from javascript - such as , and .

 

<script type="text/python">alertpromptconfirm

On the demo page there is a console in which you can run python code. According to rumors, does not work in browsers IE below the ninth version.

 

code

 

The size of the original source is about 162 kilobytes. On first impression, it seems that the library was created only for the creative fan. But this is the real python - with its regular expressions, powerful OOP, iterators, and a bunch of different buns, which is why many developers love Python so much.

 

All in all, Brython is definitely a thing! You will need to deal with the documentation and write something on it.