Spaces:
Running
Running
minimal example Pyodide
Browse files- index.html +15 -17
index.html
CHANGED
@@ -1,24 +1,22 @@
|
|
1 |
<!DOCTYPE html>
|
2 |
<html>
|
3 |
<head>
|
4 |
-
<
|
5 |
-
<meta name="viewport" content="width=device-width" />
|
6 |
-
<title>My static Space</title>
|
7 |
-
<link rel="stylesheet" href="style.css" />
|
8 |
</head>
|
9 |
<body>
|
10 |
-
<
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
|
|
23 |
</body>
|
24 |
</html>
|
|
|
1 |
<!DOCTYPE html>
|
2 |
<html>
|
3 |
<head>
|
4 |
+
<script src="https://cdn.jsdelivr.net/pyodide/v0.19.1/full/pyodide.js"></script>
|
|
|
|
|
|
|
5 |
</head>
|
6 |
<body>
|
7 |
+
Pyodide test page <br>
|
8 |
+
Open your browser console to see Pyodide output
|
9 |
+
<script type="text/javascript">
|
10 |
+
(async function main(){
|
11 |
+
const pyodide = await loadPyodide({
|
12 |
+
indexURL : "https://cdn.jsdelivr.net/pyodide/v0.19.1/full/"
|
13 |
+
});
|
14 |
+
console.log(pyodide.runPython(`
|
15 |
+
import sys
|
16 |
+
sys.version
|
17 |
+
`));
|
18 |
+
console.log(pyodide.runPython("print(1 + 2)"));
|
19 |
+
})();
|
20 |
+
</script>
|
21 |
</body>
|
22 |
</html>
|