Python in the browser

petercour - Jun 17 '19 - - Dev Community

You can use Python on the web, instead of Javascript.
Yes, really.

There's a project named Brython: "A Python 3 implementation for client-side web programming".

So how does it work:

Step 1: Include Brython

<script type="text/javascript" src="/src/brython.js"></script>

Step 2: Write your code, say

<body onload="brython(1)">

<script type="text/python">
from browser import document, alert

def echo(ev):
    alert("Hello {} !".format(document["zone"].value))

document["test"].bind("click", echo)
</script>
<p>Your name is : <input id="zone" autocomplete="off">
<button id="test">clic !</button>
</body>

Step 3: Demo https://brython.info/gallery/hello.html

More resources,

Learn python and demos

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player