-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathnamed.html
More file actions
38 lines (32 loc) · 1.08 KB
/
named.html
File metadata and controls
38 lines (32 loc) · 1.08 KB
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
33
34
35
36
37
38
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<title>named workers</title>
<script type="module" src="/dist/index.js"></script>
</head>
<body>
<script type="micropython" async>
from polyscript import workers
await (await workers["mpy"]).greetings()
await (await workers["py"]).greetings()
# print(await (await workers["mpy"]).__export__)
print(list(await (await workers["mpy"]).test()))
</script>
<script type="micropython" worker name="mpy">
def greetings():
print("micropython")
def test():
return __export__
__export__ = ['greetings', 'test']
</script>
<script type="pyodide" worker name="py">
def greetings():
print("pyodide")
def test():
return __export__
__export__ = ['greetings', 'test']
</script>
</body>
</html>