One of the promises WebAssembly makes is to allow us to use any language we choose to develop for the web, though this remains a distant goal. The philosophy behind Brython, at least as far as Python 3 is concerned, is why wait?
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. Async functionality is available, although you have to use Brython’s
async module instead of Python’s
Most of Python’s common keywords and behaviors are supported, including
[ Also on InfoWorld: 24 Python libraries for every Python developer ]
The biggest drawback to Jiphy is that it supports only a subset of Python’s features. Neither classes nor default arguments are available, although decorators and exceptions are supported. Much of this is because Jiphy strives for a line-to-line relationship between the source and target code, but its developers have eyed the new features in ES6 for more advanced Python feature support.
Note that the Jiphy project hasn’t been updated since late 2017. Jiphy should be considered strictly experimental until work on it resumes.
$ special symbol used by jQuery works as-is in RapydScript, and arrays can support both the
.append (Python) methods.
document.getElementById in Python, for instance, the converted code will use the actual
Share this post if you enjoyed! 🙂