mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-19 18:27:29 -05:00
27 lines
857 B
HTML
27 lines
857 B
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
|
|
<title>python</title>
|
|
<link rel="stylesheet" href="style.css" />
|
|
<script defer src="./counter.js"></script>
|
|
<script type="module" src="../min.js"></script>
|
|
</head>
|
|
<body>
|
|
<script type="micropython">
|
|
from js import XWorker
|
|
|
|
def show_image(event):
|
|
from js import document
|
|
img = document.createElement("img")
|
|
img.style.transform = "scale(.5)"
|
|
img.src = event.data
|
|
document.body.appendChild(img)
|
|
|
|
w = XWorker('./matplot.py', **{'type': 'pyodide', 'config': './config.toml'})
|
|
w.onmessage = show_image
|
|
</script>
|
|
</body>
|
|
</html>
|