mirror of
https://github.com/pyscript/pyscript.git
synced 2026-02-13 16:00:37 -05:00
29 lines
798 B
HTML
29 lines
798 B
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
|
|
</head>
|
|
<body>
|
|
<div>See console ➡️</div>
|
|
<script type="micropython">
|
|
from xworker import XWorker
|
|
|
|
def handle_error(event):
|
|
print("Python")
|
|
print(event.data.message)
|
|
|
|
w = XWorker('./error.py')
|
|
w.onerror = handle_error
|
|
</script>
|
|
<script type="module">
|
|
import { XWorker } from "../core.js";
|
|
|
|
const w = new XWorker("./error.py", { type: "micropython" });
|
|
w.onerror = ({ data: error }) => {
|
|
console.log('JS', error);
|
|
};
|
|
</script>
|
|
</body>
|
|
</html>
|