-
Notifications
You must be signed in to change notification settings - Fork 363
Expand file tree
/
Copy pathindex.html
More file actions
28 lines (24 loc) · 906 Bytes
/
index.html
File metadata and controls
28 lines (24 loc) · 906 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
<!DOCTYPE html>
<html>
<head>
<script src="https://cdn.jsdelivr.net/pyodide/v0.28.1/full/pyodide.js"></script>
</head>
<body>
<script type="text/javascript">
async function main() {
let pyodide = await loadPyodide();
await pyodide.loadPackage("micropip");
const micropip = pyodide.pyimport("micropip");
await pyodide.loadPackage("pillow"); // Arcade needs Pillow
await micropip.install("http://localhost:8000/static/{{pyglet_wheel}}");
await micropip.install("http://localhost:8000/static/{{arcade_wheel}}");
let response = await fetch("./package.zip");
let buffer = await response.arrayBuffer();
await pyodide.unpackArchive(buffer, "zip", "package");
pkg = pyodide.pyimport("package");
pkg.main();
}
main();
</script>
</body>
</html>