-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathimport_python_file.html
More file actions
31 lines (26 loc) · 952 Bytes
/
import_python_file.html
File metadata and controls
31 lines (26 loc) · 952 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
<!DOCTYPE html>
<html>
<head>
<!-- <link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" /> -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<script defer src="https://pyscript.net/alpha/pyscript.js"></script>
<py-env>
- paths:
- /python/random_n.py
</py-env>
</head>
<body>
<div class="container p-5">
<h1>PyScript Python File Import</h1>
<py-script src="/python/our_script.py"></py-script>
<input type="number" id="test-input" name="file" />
<button type="button" id="test-button" pys-onclick="my_function">Test</button>
<p id="test-output"></p>
<py-script>
from random_n import random_number
print(random_number())
</py-script>
</div>
</body>
</html>