My Wish has come true : We can now run  Python Code Inside HTML
Comnponents of PyScript : Credits : Ananonda

My Wish has come true : We can now run Python Code Inside HTML

Finally, my desire has come true: we can now embed Python code into HTML pages.

Because of this, Python and sophisticated UI languages such as contemporary HTML, CSS, and JavaScript have been unable to take use of each other's benefits throughout the previous few decades.

Anaconda, an open source software firm that creates Python-based environments and solutions, realised a long-held dream of many programmers, including myself, on April 30, 2022, i.e., yesterday, April 30, 2022.

I had always wished that I would be able to use Python libraries in all of my web-based apps, and this was a goal I had set for myself.

Particularly noteworthy are the data science libraries.

As a matter of fact, I intended to make use of the entire, rich, and easily available ecosystem of Python libraries directly within the HTML code.

PyScript is a new framework developed by the business that was introduced today.

PyScript's fundamental building components are as follows:

Components of PyScript

Allow for drop-in content, external file hosting (thanks to the Pyodide project for making this possible!) and application hosting without the need for server-side configuration.

Several prominent Python and scientific stack packages can be used (such as numpy, pandas, scikit-learn, and others).

Interaction between Python and JavaScript objects and namespaces: bidirectional communication between Python and JavaScript objects and namespaces

Environment management: Allow users to choose which packages and files should be included in the page code in order for it to function properly.

When developing a visual application, pre-made UI components such as buttons, containers, text boxes, and other elements are useful.

A flexible framework for developing and distributing new pluggable and extendable components that run directly in the Python stack is being developed.

It is touted by the firm to be a type of totally new technological stack that provides a clean, pluggable, and easy API that can do miracles in web development. It is currently in beta. This is due to the fact that PyScript is built on the shoulders of giants. There are a number of factors that contribute to the browser's status as a relatively stable stack, including the improvements achieved with WebAssembly/WASM, Emscripten, and Pyodide.

Despite the fact that it is not generally thought of as a virtual computer, the browser performs admirably in this capacity. The "Python Script" is depicted in Figure 1 as an architecture diagram.

The most significant drawback of Python was that it lacked a clear means to create appealing user interfaces that could be used to simply package and deploy programmes, whereas current HTML, CSS, and JavaScript confront the difficulty of having a high learning curve to contend with.

Making it possible for Python to take use of standard HTML, CSS, and JavaScript conventions not only solves those two problems, but it also tackles a broader range of web application development, packaging, distribution, and deployment issues.

Remember

It is still in its infancy and has many limitations, but it does function! , and

Examples of Python scripts may be found at https://pyscript.net/examples/ and pyscript.net, respectively.

要查看或添加评论,请登录

Puneet Arora的更多文章

社区洞察

其他会员也浏览了