Files
pyscript/docs/concepts/what-is-pyscript.md
Neil Stoker dfa837754e Remove line numbers from example (#745)
As per #565 the current best fix is to simply remove the line numbers from the output
2022-09-12 04:28:19 -04:00

1.1 KiB

What is PyScript?

The PyScript library provides HTML tags for embedding and executing Python code in your browser. PyScript is built using Pyodide, the WebAssembly port of CPython, which is compiled using Emscripten.

PyScript turns the browser into a code deployment tool that anyone can learn to use.

Example

In this example, we are using the <py-script> HTML tag to generate a Matplotlib figure and display it as an image. Click Preview to see the rendered HTML.

To try it in your browser, copy the code below into an online HTML editor like W3School's Tryit Editor, which allows you to modify, run, and even save your code. Watch the video below to see it in action!

::::{tab-set} :::{tab-item} HTML Source

---

:::

:::{tab-item} Preview

<iframe height="600px" width="100%" scrolling="auto" frameborder="0" src="../_static/examples/what-is-pyscript.html"></iframe>

::: ::::