PyScript: Using Python in the Browser
Hello, World!
(You may need to wait a few seconds for PyScript to load for results to appear. Tested on Firefox and Chrome.)
After including the following in your HTML file:
<link
rel="stylesheet"
href="https://pyscript.net/releases/2025.8.1/core.css"
/>
<script type="module" src="https://pyscript.net/releases/2025.8.1/core.js"></script>
You can now run Python in the browser, and display results directly on the page. For example:
<py-script>
print("Hello, world!")
</py-script>
Check out the PyScript documentation for more details and examples.