For faster navigation, this Iframe is preloading the Wikiwand page for PyScript.

PyScript

Матеріал з Вікіпедії — вільної енциклопедії.

PyScript[1]фреймворк, який дозволяє запускати в браузері програми на Python з використанням HTML-інтерфейсу.

Фреймворк анонсували 30 квітня 2022 року на конференції PyCon[en] 2022[2] у складі дистрибутиву Anaconda[3].

Компоненти

[ред. | ред. код]

Деякі з основних компонентів[3]:

  • Python в браузері. Уможливлення drop-in контенту, зовнішнього хостингу файлів і застосунків без залежності від конфігурації на стороні сервера
  • Екосистема Python. Використання багатьох популярних пакетів Python, навіть з наукового стеку (такі як numpy, Pandas, scikit-learn та інші)
  • Python з JavaScript. Двосторонній зв'язок між об'єктами Python та JavaScript
  • Керування середовищем. Дозволити користувачам визначити, які пакунки і файли слід включати для коду сторінки
  • Візуальна розробка додатків. Використання компонентів інтерфейсу користувача, таких як кнопки, контейнери, текстові скриньки і багато іншого
  • Гнучкі рамки. Гнучкий фреймворк, який можна використовувати для створення та обміну новими з'єднуваними та розширюваним компонентами безпосередньо в Python

PyScript — це просто HTML, посилений екосистемою бібліотек Python.

Умовно Pyscript складається з трьох основних частин: py-env, py-script і py-repl.[4]

Приклад коду

[ред. | ред. код]
#      Хотів би ти використовувати Python прямо в браузері?                         
<html>
    <head>
      <link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" />
      <script defer src="https://pyscript.net/alpha/pyscript.js"></script>
    </head>

    <body>
      <py-script> print('Тепер ти можеш!') </py-script>
    </body>

</html>

Джерела

[ред. | ред. код]
  1. Inc, Anaconda. Pyscript.net. pyscript.net (англ.). Процитовано 26 липня 2022.
  2. Ifihanagbara Olusheye (MAY 26, 2022). How to Use PyScript – A Python Frontend Framework. freeCodeCamp. Процитовано 26 липня 2022.
  3. а б Fabio Pliger (APR 30, 2022). Python in the Browser. Anaconda (New from Anaconda). Процитовано 26 липня 2022.
  4. Joy, Ashwin. Pyscript Tutorial With Simple Code Examples. Pythonista Planet (en-us) . Процитовано 26 липня 2022.

Посилання

[ред. | ред. код]
{{bottomLinkPreText}} {{bottomLinkText}}
PyScript
Listen to this article

This browser is not supported by Wikiwand :(
Wikiwand requires a browser with modern capabilities in order to provide you with the best reading experience.
Please download and use one of the following browsers:

This article was just edited, click to reload
This article has been deleted on Wikipedia (Why?)

Back to homepage

Please click Add in the dialog above
Please click Allow in the top-left corner,
then click Install Now in the dialog
Please click Open in the download dialog,
then click Install
Please click the "Downloads" icon in the Safari toolbar, open the first download in the list,
then click Install
{{::$root.activation.text}}

Install Wikiwand

Install on Chrome Install on Firefox
Don't forget to rate us

Tell your friends about Wikiwand!

Gmail Facebook Twitter Link

Enjoying Wikiwand?

Tell your friends and spread the love:
Share on Gmail Share on Facebook Share on Twitter Share on Buffer

Our magic isn't perfect

You can help our automatic cover photo selection by reporting an unsuitable photo.

This photo is visually disturbing This photo is not a good choice

Thank you for helping!


Your input will affect cover photo selection, along with input from other users.

X

Get ready for Wikiwand 2.0 🎉! the new version arrives on September 1st! Don't want to wait?