You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -124,15 +122,17 @@ HTML head. You can also link to `.whl` files directly on disk like in our [toga
124
122
</py-env>
125
123
```
126
124
125
+
If your `.whl` is not a pure Python wheel then open a PR or issue with [pyodide](https://github.com/pyodide/pyodide) to get it added here https://github.com/pyodide/pyodide/tree/main/packages
126
+
127
127
For example, NumPy and Matplotlib are available. Notice here we're using `<py-script output="plot">`
128
128
as a shortcut, which takes the expression on the last line of the script and runs `pyscript.write('plot', fig)`.
If your `.whl` is not a pure Python wheel then open a PR or issue with [pyodide](https://github.com/pyodide/pyodide) to get it added here https://github.com/pyodide/pyodide/tree/main/packages
160
+
### Local modules
161
+
162
+
In addition to packages you can declare local Python modules that will
163
+
be imported in the `<py-script>` tag. For example we can place the random
164
+
number generation steps in a function in the file `data.py`.
165
+
166
+
```python
167
+
# data.py
168
+
import numpy as np
169
+
170
+
defmake_x_and_y(n):
171
+
x = np.random.randn(n)
172
+
y = np.random.randn(n)
173
+
return x, y
174
+
```
175
+
176
+
In the HTML tag `<py-env>` paths to local modules are provided in the
0 commit comments