-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathinterpreter.html
More file actions
32 lines (32 loc) · 860 Bytes
/
interpreter.html
File metadata and controls
32 lines (32 loc) · 860 Bytes
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
mpy-script { display: none; }
script-mpy { display: block; }
</style>
<script type="module">
import { define } from '/dist/index.js';
define('mpy', {
interpreter: 'micropython',
// version: '1.20.0-295',
// version: 'https://cdn.jsdelivr.net/npm/@micropython/micropython-webassembly-pyscript@1.20.0-295/micropython.mjs',
hooks: {
main: {
onReady({ run }, element) {
run(`
import sys
print(sys.version)
`);
}
}
}
});
</script>
</head>
<body>
<script type="mpy"></script>
</body>
</html>