mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-21 03:05:38 -05:00
30 lines
994 B
HTML
30 lines
994 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="../core.js"></script>
|
|
</head>
|
|
<body>
|
|
<script type="micropython">
|
|
from xworker import XWorker
|
|
w = XWorker('./matplot.py', **{'type': 'pyodide', 'config': './config.toml'})
|
|
|
|
# xworker.window made the following completely unnecessary
|
|
|
|
# def show_image(event):
|
|
# from js import document
|
|
# img = document.createElement("img")
|
|
# img.style.transform = "scale(.5)"
|
|
# img.src = event.data
|
|
# document.querySelector("#image").append(img)
|
|
|
|
# w.onmessage = show_image
|
|
</script>
|
|
<div id="image"></div>
|
|
</body>
|
|
</html>
|