-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathpyscript-sample.html
More file actions
33 lines (32 loc) · 1.4 KB
/
pyscript-sample.html
File metadata and controls
33 lines (32 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<!doctype html>
<!--
This is https://github.com/wilsonmar/python-samples/blob/main/pyscript-sample.html
to run Python code withing HTML using the pyscript library.
USAGE in local browser:
file:///Users/johndoe/github-wilsonmar/python-samples/pyscript-sample.html
Docs : https://docs.pyscript.net/2025.2.4/
__last_change__ = "25-11-10 v002 + links :pyscript-sample.html"
__status__ = "simplest display WORKING on local browser"
-->
<html>
<head>
<!-- Recommended meta tags -->
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<!-- PyScript CSS -->
<link rel="stylesheet" href="https://pyscript.net/releases/2025.2.4/core.css">
<!-- This script tag bootstraps PyScript -->
<script type="module" src="https://pyscript.net/releases/2025.2.4/core.js"></script>
</head>
<body>
<!-- Now you can use <py-script> tag to write your python code inside-->
<py-script>
import sys
from pyscript import display
display("Using PyScript to run Python in internet browsers: version:")
display(sys.version)
</py-script>
<a target="_blank" href="https://docs.pyscript.net/2025.2.4/">https://docs.pyscript.net/2025.2.4/</a><br />
<a target="_blank" href="https://docs.pyscript.net/2025.2.4/examples/">Sample applications</a>
</body>
</html>