-
Notifications
You must be signed in to change notification settings - Fork 1
/
python_test.html
67 lines (50 loc) · 1.55 KB
/
python_test.html
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
---
layout: default
title: Python Test
---
<script type="text/javascript">
// set the pyodide files URL (packages.json, pyodide.asm.data etc)
window.languagePluginUrl = 'assets/pyodide/';
</script>
<script src="assets/pyodide/pyodide.js"></script>
<script src="assets/js/tf.js"></script>
<script src="assets/js/tf_loading.js"></script>
<script src="assets/js/jquery-3.5.1.js"></script>
<link rel="stylesheet" href="assets/js/chessboardjs/css/chessboard-1.0.0.css" />
<script src="assets/js/chessboardjs/js/chessboard-1.0.0.js"></script>
<link rel="stylesheet" href="assets/css/style.css" />
<link rel="stylesheet" href="assets/css/widget_boards.css" />
<!--<script src="assets/pyodide/pyodide.js"></script>-->
<h1>Python testing</h1>
<p>
Pyodide test page <br>
Open your browser console to see pyodide output
</p>
<div class="view-container">
<div class="board-display">
<div id="explorer-board" class="explorer-board">
<h2>Loading</h2>
<noscript>You need Javascript enabled to use this</noscript>
</div>
</div>
<div class="model-controls">
<button id='tf_button' onclick="tf_eval()" type="button" disabled>Run TF</button>
<table id="json_display">
<tr>
<th>Move</th>
<th>P</th>
</tr>
</table>
</div>
</div>
<script src="assets/js/pyiodine_backend.js"></script>
<script type="text/javascript">
pythonCode = `
{% include python_functions.py %}
`
languagePluginLoader.then(() => {
return pyodide.loadPackage(['micropip', 'numpy'])
}).then(() => {
pyodide.runPython(pythonCode);
});
</script>