Brython with Python

Brython with Python

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:

  1. manipulate the dom
  2. using the local storage
  3. making ajax call using python…all without javascript
  4. bind elements to events
  5. select elements from DOM
  6. create alerts
  7. insert into the dom
  8. bind to text elements
  9. use variables
  10. make ajax requests or http request
  11. load files and show their content
  12. manipulate css
  13. 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...

1_RIhCgpLy-93v5_i3T5aAYg.jpeg Create your html file and add some styling to it add the onload=’brython()’ to the body tag

1_S1mY5Eoy4zBj8FC21qOCpQ.jpeg 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

1_yDm8Rsh8zrBN6GMdLAywfQ.jpeg Thank you for reading! Cheers