Skip to main content


Showing posts from March, 2015

Brython: Python in Browser

Brython is python in browser.

Yes, You can just run it in the browser.

What you need is to get brython.js from their github.

And put it into some folder of your choice.

Now create a html file and call that js.

<html><head><script src="brython.js"></script></head><bodyonload="brython()"><script type="text/python"> from browser importdocument, alert, console def echo(ev): alert(document["zone"].value) console.log('Hi, this is from python') document['mybutton'].bind('click',echo) </script><inputid="zone"><buttonid="mybutton">click !</button></body></html>
Here is piece of code i copied from their website (Infact, modified a little bit).

What is important?
1. including

<script src="brython.js"></script>
Yes this line, calling/…