Also on noeticforce.com – Tools for Python and C interoperability
Brython is growing in popularity and is currently under heavy development. To try your hands on with Brython, all you need to do is include the below on the webpage.
Above gives you access to the latest development version, check out the Brython official website (link below) to pick the stable version that can be used in production. You can also include Brython from a couple of CDN options given in the Brython documentation.
How does it Work?
Why use Transcrypt –
- Capable to run on node Js.
- Allows use of features like async/await, decorators, inheritance, operator overloading etc.
- Free to use, great documentation and growing community.
Pyodide is among the most maintained and updated projects and compiles Python to WebAssembly. Pyodide provides a Python runtime environment in the browser and includes most of the scientific python libraries like scikit-learn, SciPy, Matplotlib, Pandas, and NumPy out of the box.
Though the inclusion of these libraries makes the overall code a bit heavy, the code executes fast since Pyodide uses direct Web APIs. Also, while Pyodide is batteries included when it comes to scientific development, you can still include other Python libraries from Pypi.
Skulpt – In Browser Python development
Skulpt provides you with a Python development environment in the browser itself eliminating the need to install and set up Python on your computer.
The Skulpt online Python editor is a perfect option for Python students and beginners, and for that reason, many trainers utilize Skulpt to provide Python training to beginners.
Skulpt was an experimental project of graham Scott but fast grew in popularity. As of today, many popular projects like Trinket, Runestone, CodeSkulptor, and anvil utilize the Skulpt engine to provide an online Python coding environment.
Anvil is a commercial project and provides the capability to develop full-stack applications using just Python. It is more like an online integrated development environment and offers drag and drop functionality along with Python scripting.
- Drag and drop user interface to build web components
- Option to write client-side Python Script for dynamic web pages and form validations
- Option to write Server-side Python code to execute and serve HTTP requests
- Data Tables as built-in database
- Capability to include existing python libraries
Apart from the above, Anvil also provides one-click hosting, emails management, integration with third-party services like Stripe payments, Facebook, google apps, and more.
PyJS is a rich application development platform and was built by porting Google Web Toolkit widgets. It can be used to develop both web and desktop-based applications using pure Python. PyJS includes a python compiler, Ajax, and API-powered widgets.
While PyJS concept and project was a great idea, it is a dying project now without any significant development over the last few years.
All in all, you can mix both python and JS code and include python libraries as well as node js modules in the code, and compile it all to Python in the end.
For now, ECMA 5 is supported out of the box whereas ECMA 6 can be converted to Python in 2 steps. Convert ECMA 6 to ECMA5 using Babel transpilers and then you know the next step.
- Provides bidirectional call-back support including the use of arbitrary arguments
- Garbage collection out of the box
- Exception handling support async and sync functions interoperability
- And much more.
JSPyBridge is also under development and should be used with care for production use.
A Python trainer or course creator might go for Skulpt, a full stack Python developer might pay for Anvil, a frontend developer might like Brython more than all other options. It is important to pick the right tool for your use case to get the maximum efficiency and benefits.
Further reading – Python IDE Mac, Windows and Linux