Python Code Block using Pyodide

The Python Code block relies on the Pyodide project. It allows us to run Python Code directly in the browser.

Next, we use two Text Editor (JSON content) blocks to allow the visitors to provide two variables.

is loading …
is loading …

We are using the “+” operator between the content of the two blocks above.
The Python block can run on demand (press Run), automatically, and one can even hide it.
Moreover, we can make it editable, so the users can change it.

is loading …

And below we display the result in a Text Viewer block.

is loading …

Feel free to experiment, e.g. change the variables to numbers or arrays.

For more details please see the corresponding documentation.


First Published

in

Last Updated

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *