Brython implements a version of Python 3 for client-side web programming via a JavaScript library

Brython implements a version of Python 3 for client-side web programming via a JavaScript library

https://www.infoworld.com/article/3209651/python/how-to-convert-python-to-javascript-and-back-again.html

Brython implements a version of Python 3 for client-side web programming via a JavaScript library

Brython

Someday, when WebAssembly becomes a reality, it may be possible to develop for the web in any language we choose. The philosophy behind Brython, at least as far as Python 3 is concerned, is why wait?

Brython implements a version of Python 3 for client-side web programming via a JavaScript library that emulates all of the keywords and most of the built-ins for Python 3. Scripts written in Python can be included directly in a webpage. Brython supplies a high-level Python module interface (the 

1
browser

package) to interact with the DOM and the browser, i.e. to handle all of the work normally done directly in JavaScript.

Plenty of live code examples and a gallery of mini-applications demonstrate how it all works. It’s even possible to use Brython to write a native Android app in Python. Plans are in the works to support Python’s async functionality and to eventually use WebAssembly as a compilation target.

Brython does not escape the restrictions imposed on JavaScript in the browser. For example, there is no support for dealing with the local filesystem. There is, however, support for using HTML5 local storage, if all you need is some way to persist data on a per-application basis.

Related posts