The PyScript project develops a platform for executing Python scripts in a web browser

The PyScript project is presented, which allows integrating Python handlers into web pages and creating interactive web applications in Python. Applications are given access to the DOM and an interface for bi-directional interaction with JavaScript objects. The web application development logic is preserved, and the differences come down to the possibility of using the Python language instead of JavaScrpt. The PyScript sources are distributed under the Apache 2.0 license.

Unlike the Brython project, which compiles Python code to JavaScript, PyScript uses Pyodide, a browser-side port of CPython compiled to WebAssembly, to execute Python code. Using Pyodide allows you to achieve full compatibility with Python 3 and use all the features of the language and library, including for scientific computing, such as numpy, pandas and scikit-learn. From the PyScript side, a layer is provided for integrating Python code with JavaScript, inserting code into web pages, importing modules, organizing I / O, and solving other related tasks. The project provides a set of widgets (buttons, text blocks, etc.) for creating a web interface in Python.

The PyScript project develops a platform for executing Python scripts in a web browser

Using PyScript comes down to connecting the pyscript.js script and the pyscript.css style sheet, after which it becomes possible to integrate the Python code placed inside the tag onto the pages , or connecting files via a tag . The project also provides the tag with an implementation of an environment for interactive code execution (REPL). To define paths to local modules, use the " ". … print('Hello World!') -numpy -matplotlib -paths: -/data.py …

Source: opennet.ru

Add a comment