Brython with Python😎
Running python on the client-side in the browswer using Brython
Brython is a Python 3 implementation for client-side web programming Brython is designed to replace Javascript as the scripting language for the Web. As such, it is a Python 3 implementation (you can take it for a test drive through a web console), adapted to the HTML5 environment, that is to say with an interface to the DOM objects and events.
With Brython you can do a lot, example is listed below:
- manipulate the dom
- using the local storage
- making ajax call using python…all without javascript
- bind elements to events
- select elements from DOM
- create alerts
- insert into the dom
- bind to text elements
- use variables
- make ajax requests or http request
- load files and show their content
- manipulate css
- adding and removing from local storage e.t.c Goto brython.info (check out the demo, documentation, community) You can download the brython source file on the website or use the CDN cdnjs.cloudflare.com/ajax/libs/brython/3.8... cdnjs.cloudflare.com/ajax/libs/brython/3.8...
Create your html file and add some styling to it add the onload=’brython()’ to the body tag
Make use of id in your html tags because thats how you can relate with python Then add a script tag and set the type to type=”text/python” then give it an id Note all functionalities have their different ids
Thank you for reading! Cheers